2022-04-16 14:55:25 +02:00
|
|
|
from itertools import count
|
|
|
|
|
2022-05-09 15:49:11 +02:00
|
|
|
from data.enum.ItemType import ItemType
|
2022-03-24 20:43:53 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Item:
|
2022-04-16 14:55:25 +02:00
|
|
|
id_counter = count(start=0)
|
|
|
|
|
|
|
|
def __init__(self, type: ItemType):
|
|
|
|
self.id = next(self.id_counter)
|
|
|
|
self.category = type
|
|
|
|
self.price = self.price_factory(type)
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def price_factory(self, type: ItemType):
|
|
|
|
return 1
|