Merge branch 'master' of ctpug.org.za:koperkapel
[koperkapel.git] / koperkapel / vehicles / walking.py
1 """ A vehicle to represent roaches on foot. """
2
3 from .base import Vehicle, circle_of_seats
4 from ..roaches import (
5     default_roaches, roaches_quartet, roaches_nonet, WorldRoach)
6
7
8 class Walking(Vehicle):
9
10     vehicle_type = "walking"
11
12     def init_seats(self):
13         return circle_of_seats(6, vehicle=self)
14
15     def get_avatar(self, world):
16         num_roaches = len(world.roaches)
17         roach = WorldRoach()
18         if num_roaches == 1:
19             # Return a single large roach
20             avatar = default_roaches.assemble(roach)
21             avatar.anchor = (0, 0)
22         elif num_roaches < 6:
23             avatar = roaches_quartet.assemble(roach)
24             avatar.anchor = (0, 0)
25         else:
26             avatar = roaches_nonet.assemble(roach)
27             avatar.anchor = (0, 0)
28         return avatar