From 298fba3f6d05e5f20f01c38e46f6c1ad03f4f388 Mon Sep 17 00:00:00 2001 From: Maksymilian Szygenda Date: Sun, 26 Mar 2023 16:33:42 +0200 Subject: [PATCH 1/3] Upload files to '' --- garbageTruck.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 garbageTruck.py diff --git a/garbageTruck.py b/garbageTruck.py new file mode 100644 index 0000000..c8c098b --- /dev/null +++ b/garbageTruck.py @@ -0,0 +1,33 @@ +from typing import List + +class garbageTruck: + position: List[int, int] + paper: [] + plastic_and_metal: [] + glass: [] + bio: [] + mixed: [] + 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: + self.mixed.append(RecognizedGarbage) \ No newline at end of file From bfd78aee9044e59f2162746aa0210da4bf36a118 Mon Sep 17 00:00:00 2001 From: Maksymilian Szygenda Date: Sun, 26 Mar 2023 20:58:43 +0200 Subject: [PATCH 2/3] Update 'garbageTruck.py' --- garbageTruck.py | 66 +++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/garbageTruck.py b/garbageTruck.py index c8c098b..4385c51 100644 --- a/garbageTruck.py +++ b/garbageTruck.py @@ -1,33 +1,35 @@ -from typing import List - -class garbageTruck: - position: List[int, int] - paper: [] - plastic_and_metal: [] - glass: [] - bio: [] - mixed: [] - 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: +from typing import List + +class GarbageTruck: + position: Tuple[int, int] + paper: [] + plastic_and_metal: [] + glass: [] + bio: [] + mixed: [] + RecognizedGarbage: [] + 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: self.mixed.append(RecognizedGarbage) \ No newline at end of file From 18cc38b3ffc232d81aaf865df3e61118ec6b34a0 Mon Sep 17 00:00:00 2001 From: Maksymilian Szygenda Date: Sun, 26 Mar 2023 21:13:05 +0200 Subject: [PATCH 3/3] Update 'garbageTruck.py' --- garbageTruck.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/garbageTruck.py b/garbageTruck.py index 4385c51..2b0fad5 100644 --- a/garbageTruck.py +++ b/garbageTruck.py @@ -2,12 +2,11 @@ from typing import List class GarbageTruck: position: Tuple[int, int] - paper: [] - plastic_and_metal: [] - glass: [] - bio: [] - mixed: [] - RecognizedGarbage: [] + paper: List[RecognizedGarbage] + plastic_and_metal: List[RecognizedGarbage] + glass: List[RecognizedGarbage] + bio: List[RecognizedGarbage] + mixed: List[RecognizedGarbage] truckSpritePath = 'imgs/dust_car.png' def __init__(self, position: List[int, int]) -> None: self.position = position