Add roach_at helper.
authorSimon Cross <hodgestar@gmail.com>
Sat, 5 Mar 2016 13:29:18 +0000 (15:29 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sat, 5 Mar 2016 13:29:18 +0000 (15:29 +0200)
koperkapel/vehicles/base.py

index 31f7eeaaa4f9ced6ac2285ab336038afd7975841..c2a24f64ecbfb6cb5d9f27cc03ae11da0a3cf141 100644 (file)
@@ -41,6 +41,12 @@ class Vehicle:
         # line below records new seating on the world proxy
         vehicle.seating = seating
 
+    def roach_at(self, world, seat_pos):
+        roach_seating = world.vehicles[self.vehicle_type].seating
+        if seat_pos >= len(roach_seating):
+            return None
+        return roach_seating[seat_pos]
+
     _vehicle_types = {}
 
     @classmethod