Merge branch 'master' of ctpug.org.za:koperkapel
[koperkapel.git] / koperkapel / roaches.py
index b39d189fe669c6571047973feb33f8b7b6e4eecc..95353ee18a441bdf947bb4cf07586c41e1faa18b 100644 (file)
@@ -8,6 +8,13 @@ from .actors.orientatedsurf import OrientatedSurfActor
 from .serums import roach_serum_color
 
 
+def roach_by_name(world, roach_name):
+    roaches = [r for r in world.roaches if r.name == roach_name]
+    if not roaches:
+        return None
+    return roaches[0]
+
+
 class RoachActor(OrientatedSurfActor):
     def __init__(self, frames):
         self._frames = frames