2020-05-18 17:24:03 +02:00
|
|
|
import pygame
|
|
|
|
|
2020-05-18 17:33:48 +02:00
|
|
|
|
2020-05-18 17:24:03 +02:00
|
|
|
class Shelf:
|
|
|
|
|
2020-06-09 17:17:08 +02:00
|
|
|
def __init__(self, x, y):
|
|
|
|
self.x = x
|
|
|
|
self.y = y
|
2020-05-18 17:24:03 +02:00
|
|
|
self.products = []
|
|
|
|
|
2020-06-09 17:17:08 +02:00
|
|
|
def add_product(self, product):
|
|
|
|
self.products.append(product)
|
|
|
|
|
|
|
|
def get_product(self):
|
|
|
|
return self.products[0]
|
|
|
|
|
|
|
|
def get_coordinates(self):
|
|
|
|
c = [self.x, self.y]
|
|
|
|
return c
|
|
|
|
|
|
|
|
def is_empty(self):
|
|
|
|
if len(self.products) == 0:
|
|
|
|
return True
|
|
|
|
else:
|
|
|
|
return False
|
|
|
|
|