GarbageTruck #10

Merged
s473616 merged 3 commits from s464933-patch-1 into master 2023-03-26 21:13:50 +02:00
Showing only changes of commit bfd78aee90 - Show all commits

View File

@ -1,12 +1,13 @@
from typing import List
class garbageTruck:
position: List[int, int]
class GarbageTruck:
s473616 marked this conversation as resolved Outdated

możesz używać Pascal Case do nazywania klas? Czyli w naszym wypadku "GarbageTruck"

możesz używać Pascal Case do nazywania klas? Czyli w naszym wypadku "GarbageTruck"
position: Tuple[int, int]
s473616 marked this conversation as resolved Outdated

Tuple zamiast List?

Tuple zamiast List?
paper: []

Typ listy: RecognizedGarbage

Typ listy: RecognizedGarbage

chodzi o to, żeby listy śmieci były typowane, czyli np. paper: List[RecognizedGarbage], tak dla wszystkich list

chodzi o to, żeby listy śmieci były typowane, czyli np. paper: List[RecognizedGarbage], tak dla wszystkich list
plastic_and_metal: []
glass: []
bio: []
mixed: []
RecognizedGarbage: []
truckSpritePath = 'imgs/dust_car.png'
def __init__(self, position: List[int, int]) -> None:
self.position = position
@ -16,6 +17,7 @@ class garbageTruck:
self.bio = []
self.mixed = []
def sort_garbage(self, RecognizedGarbage) -> None:
if RecognizedGarbage.garbage_type == 0:
self.paper.append(RecognizedGarbage)