projects
/
koperkapel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0dc9a8b
)
Implement 5s rule for seating.
author
Simon Cross
<hodgestar@gmail.com>
Sat, 5 Mar 2016 11:38:22 +0000
(13:38 +0200)
committer
Simon Cross
<hodgestar@gmail.com>
Sat, 5 Mar 2016 11:38:22 +0000
(13:38 +0200)
koperkapel/vehicles/base.py
patch
|
blob
|
history
diff --git
a/koperkapel/vehicles/base.py
b/koperkapel/vehicles/base.py
index 1b2f3ed279ff471ff9d151d9c5a4ca93e7e3ba24..f4506d602bfb520c0235ef9b4ac23f6cb475671a 100644
(file)
--- a/
koperkapel/vehicles/base.py
+++ b/
koperkapel/vehicles/base.py
@@
-18,18
+18,19
@@
class Vehicle:
def init_seats(self):
raise NotImplementedError("Vehicles should specify a list of seats")
def init_seats(self):
raise NotImplementedError("Vehicles should specify a list of seats")
- def assign_seats(self, seating):
- for roach_name, seat in zip(seating, self.seats):
- seat.roach = roach_name
+ 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):
_vehicle_types = {}
@classmethod
def current(cls, world):
- vehicle = cls.by_type(world.vehicles.current)
- vehicle.assign_seats(
- world.vehicles[vehicle.vehicle_type].seating)
- return vehicle
+ return cls.by_type(world.vehicles.current)
@classmethod
def by_type(cls, vehicle_type):
@classmethod
def by_type(cls, vehicle_type):