From: Simon Cross Date: Sat, 5 Mar 2016 13:29:18 +0000 (+0200) Subject: Add roach_at helper. X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=55c4bcf03552816d8da08974179aac95b40996af;p=koperkapel.git Add roach_at helper. --- 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