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-06-09 20:46:21 +02:00
|
|
|
self.level1 = []
|
|
|
|
self.level2 = []
|
|
|
|
self.level3 = []
|
|
|
|
|
2020-05-18 17:24:03 +02:00
|
|
|
|
2020-06-09 17:17:08 +02:00
|
|
|
def add_product(self, product):
|
2020-06-09 20:46:21 +02:00
|
|
|
if product[7] == 1:
|
|
|
|
self.level1.append(product)
|
|
|
|
elif product[7] == 2:
|
|
|
|
self.level2.append(product)
|
|
|
|
else:
|
|
|
|
self.level3.append(product)
|
2020-06-09 17:17:08 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|