forked from s444420/AL-2020
3 levels on shelf.py
This commit is contained in:
parent
54c0d48184
commit
1b9049d613
3
board.py
3
board.py
@ -8,9 +8,6 @@ shelfs_o = []
|
|||||||
|
|
||||||
def create_board(screen):
|
def create_board(screen):
|
||||||
board = []
|
board = []
|
||||||
# # shelfs = [(250, 150), (250, 250), (450, 150), (450, 250), (650, 150), (650, 250), (850, 150), (850, 250),
|
|
||||||
# (250, 450), (350, 450), (750, 450), (850, 450),
|
|
||||||
# (250, 650), (250, 750), (450, 650), (450, 750), (650, 650), (650, 750), (850, 650), (850, 750)]
|
|
||||||
|
|
||||||
shelfs = [
|
shelfs = [
|
||||||
(50, 50), (150, 50), (450, 50), (550, 50), (850, 50), (950, 50),
|
(50, 50), (150, 50), (450, 50), (550, 50), (850, 50), (950, 50),
|
||||||
|
12
shelf.py
12
shelf.py
@ -6,10 +6,18 @@ class Shelf:
|
|||||||
def __init__(self, x, y):
|
def __init__(self, x, y):
|
||||||
self.x = x
|
self.x = x
|
||||||
self.y = y
|
self.y = y
|
||||||
self.products = []
|
self.level1 = []
|
||||||
|
self.level2 = []
|
||||||
|
self.level3 = []
|
||||||
|
|
||||||
|
|
||||||
def add_product(self, product):
|
def add_product(self, product):
|
||||||
self.products.append(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):
|
def get_product(self):
|
||||||
return self.products[0]
|
return self.products[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user