2023-04-21 14:31:17 +02:00
|
|
|
FIELDWIDTH = 50
|
|
|
|
|
2023-03-31 13:49:27 +02:00
|
|
|
class GarbageTank:
|
2023-03-28 18:00:13 +02:00
|
|
|
def __init__(self, volume_capacity, mass_capacity):
|
|
|
|
self.vcapacity = volume_capacity #m^3
|
|
|
|
self.mcapacity = mass_capacity #kg
|
|
|
|
|
|
|
|
class Engine:
|
|
|
|
def __init__(self, power):
|
|
|
|
self.power = power #HP
|
|
|
|
|
2023-03-31 13:49:27 +02:00
|
|
|
class GarbageTruck:
|
2023-04-21 14:31:17 +02:00
|
|
|
def __init__(self, dump_location, fuel_capacity, rect, orientation):
|
2023-03-28 18:00:13 +02:00
|
|
|
self.dump_location = dump_location
|
2023-03-31 13:49:27 +02:00
|
|
|
self.tank = GarbageTank(15, 18000)
|
2023-03-28 18:00:13 +02:00
|
|
|
self.engine = Engine(400)
|
|
|
|
self.fuel = fuel_capacity
|
2023-04-21 14:31:17 +02:00
|
|
|
self.rect = rect
|
2023-04-19 21:16:40 +02:00
|
|
|
self.orientation = orientation
|
2023-04-21 14:31:17 +02:00
|
|
|
self.houses = [] #lista domów do odwiedzenia
|
|
|
|
|
|
|
|
def turn_left(self):
|
|
|
|
self.orientation = (self.orientation - 1) % 4
|
|
|
|
|
|
|
|
def turn_right(self):
|
|
|
|
self.orientation = (self.orientation + 1) % 4
|
|
|
|
|
|
|
|
def forward(self):
|
|
|
|
if self.orientation == 0:
|
|
|
|
self.rect.x += FIELDWIDTH
|
|
|
|
elif self.orientation == 1:
|
|
|
|
self.rect.y += FIELDWIDTH
|
|
|
|
elif self.orientation == 2:
|
|
|
|
self.rect.x -= FIELDWIDTH
|
|
|
|
else:
|
|
|
|
self.rect.y -= FIELDWIDTH
|