projects
/
koperkapel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
803254e
)
Add roach_by_name helper.
author
Simon Cross
<hodgestar@gmail.com>
Sat, 5 Mar 2016 13:28:45 +0000
(15:28 +0200)
committer
Simon Cross
<hodgestar@gmail.com>
Sat, 5 Mar 2016 13:28:45 +0000
(15:28 +0200)
koperkapel/roaches.py
patch
|
blob
|
history
diff --git
a/koperkapel/roaches.py
b/koperkapel/roaches.py
index 0d2448216c16a00900759736ed66e32fe975dbcb..6dedf305fd3b50b96e3da5c2e748b9f32551964e 100644
(file)
--- a/
koperkapel/roaches.py
+++ b/
koperkapel/roaches.py
@@
-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