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 21:23:10 +02:00
|
|
|
def __init__(self, field, color):
|
|
|
|
self.field = field
|
|
|
|
self.color = color
|
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
|
|
|
|
2020-06-09 21:23:10 +02:00
|
|
|
def get_field(self):
|
2020-06-10 00:03:58 +02:00
|
|
|
|
2020-06-09 21:23:10 +02:00
|
|
|
return self.field
|
|
|
|
|
2020-06-09 21:57:37 +02:00
|
|
|
def get_color(self):
|
|
|
|
return self.color
|