From 55c4bcf03552816d8da08974179aac95b40996af Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sat, 5 Mar 2016 15:29:18 +0200 Subject: [PATCH] Add roach_at helper. --- koperkapel/vehicles/base.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/koperkapel/vehicles/base.py b/koperkapel/vehicles/base.py index 31f7eea..c2a24f6 100644 --- a/koperkapel/vehicles/base.py +++ b/koperkapel/vehicles/base.py @@ -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 -- 2.34.1