X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=koperkapel%2Froaches.py;h=6dedf305fd3b50b96e3da5c2e748b9f32551964e;hb=9ab469b266d1c4446b2b84af4522f68d0074d940;hp=0d2448216c16a00900759736ed66e32fe975dbcb;hpb=663cf50f914ef479622e517463f4b03604c297c9;p=koperkapel.git diff --git a/koperkapel/roaches.py b/koperkapel/roaches.py index 0d24482..6dedf30 100644 --- 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