def init_seats(self):
raise NotImplementedError("Vehicles should specify a list of seats")
+ def seating(self, world):
+ roach_seating = world.vehicles[self.vehicle_type].seating
+ roach_seating_numbers = enumerate(zip(roach_seating, self.seats))
+ return {
+ roach: seat_pos
+ for seat_pos, (roach, _) in roach_seating_numbers if roach
+ }
+
_vehicle_types = {}
+ @classmethod
+ def current(cls, world):
+ return cls.by_type(world.vehicles.current)
+
@classmethod
def by_type(cls, vehicle_type):
return cls._vehicle_types.get(vehicle_type)()