Merge branch 'master' of ctpug.org.za:koperkapel
[koperkapel.git] / koperkapel / vehicles / base.py
index 31f7eeaaa4f9ced6ac2285ab336038afd7975841..47588a59c5450aaaabd5f74ac120302c65037f50 100644 (file)
@@ -16,6 +16,7 @@ class Vehicle:
 
     def __init__(self):
         self.seats = self.init_seats()
+        self.game_pos = (0, 0)
 
     def roach_management_overlay(self):
         return Actor("vehicles/%s/background" % (self.vehicle_type,))
@@ -41,6 +42,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
@@ -60,6 +67,9 @@ class Vehicle:
         from .walking import Walking
         cls.register(Walking)
 
+    def get_avatar(self, world):
+        raise NotImplementedError("Vehicles should know how to create their own avatars.")
+
 
 class Seat:
     """ A space in a vehicle for a roach.