2023-03-27 11:50:23 +02:00
|
|
|
from typing import List, Tuple
|
|
|
|
|
|
|
|
from garbage import RecognizedGarbage
|
2023-03-26 20:58:43 +02:00
|
|
|
|
|
|
|
class GarbageTruck:
|
|
|
|
position: Tuple[int, int]
|
2023-03-26 21:13:05 +02:00
|
|
|
paper: List[RecognizedGarbage]
|
|
|
|
plastic_and_metal: List[RecognizedGarbage]
|
|
|
|
glass: List[RecognizedGarbage]
|
|
|
|
bio: List[RecognizedGarbage]
|
|
|
|
mixed: List[RecognizedGarbage]
|
2023-03-26 20:58:43 +02:00
|
|
|
truckSpritePath = 'imgs/dust_car.png'
|
|
|
|
def __init__(self, position: List[int, int]) -> None:
|
|
|
|
self.position = position
|
|
|
|
self.paper = []
|
|
|
|
self.plastic_and_metal = []
|
|
|
|
self.glass = []
|
|
|
|
self.bio = []
|
|
|
|
self.mixed = []
|
|
|
|
|
|
|
|
|
|
|
|
def sort_garbage(self, RecognizedGarbage) -> None:
|
|
|
|
if RecognizedGarbage.garbage_type == 0:
|
|
|
|
self.paper.append(RecognizedGarbage)
|
|
|
|
|
|
|
|
elif RecognizedGarbage.garbage_type == 1:
|
|
|
|
self.plastic_and_metal.append(RecognizedGarbage)
|
|
|
|
|
|
|
|
elif RecognizedGarbage.garbage_type == 3:
|
|
|
|
self.glass.append(RecognizedGarbage)
|
|
|
|
|
|
|
|
elif RecognizedGarbage.garbage_type == 4:
|
|
|
|
self.bio.append(RecognizedGarbage)
|
|
|
|
|
|
|
|
elif RecognizedGarbage.garbage_type == 5:
|
2023-03-26 16:33:42 +02:00
|
|
|
self.mixed.append(RecognizedGarbage)
|