SI_InteligentnyWozekWidlowy/data/Order.py

21 lines
596 B
Python
Raw Normal View History

2022-04-16 14:55:25 +02:00
from itertools import count
2022-05-22 16:27:36 +02:00
from typing import List
2022-04-16 14:55:25 +02:00
2022-05-09 15:49:11 +02:00
from data.ClientParams import ClientParams
2022-04-16 14:55:25 +02:00
from data.Item import Item
2022-05-09 15:49:11 +02:00
from data.enum.Priority import Priority
2022-03-24 20:43:53 +01:00
class Order:
2022-04-16 14:55:25 +02:00
id_counter = count(start=0)
2022-05-22 16:27:36 +02:00
def __init__(self, time: int, items: [Item], priority: Priority, client_params: ClientParams):
2022-04-16 14:55:25 +02:00
self.id = next(self.id_counter)
self.time = time
2022-05-22 16:27:36 +02:00
self.items: List[Item] = items
self.client_params = client_params
2022-05-09 15:49:11 +02:00
self.priority = priority
2022-05-22 16:27:36 +02:00
def __repr__(self) -> str:
return "items: {} priority: {}".format(self.items, self.priority)