AL-2020/shelf.py
2020-06-09 20:46:21 +02:00

35 lines
666 B
Python

import pygame
class Shelf:
def __init__(self, x, y):
self.x = x
self.y = y
self.level1 = []
self.level2 = []
self.level3 = []
def add_product(self, product):
if product[7] == 1:
self.level1.append(product)
elif product[7] == 2:
self.level2.append(product)
else:
self.level3.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