X-Git-Url: https://git.ctpug.org.za/?p=koperkapel.git;a=blobdiff_plain;f=koperkapel%2Froaches.py;h=95353ee18a441bdf947bb4cf07586c41e1faa18b;hp=b39d189fe669c6571047973feb33f8b7b6e4eecc;hb=20d1e19f23c04daf107ede8c9fe57b97005a37fd;hpb=bc8a030300c8367c5412585ffe37c07ce2d7bcee diff --git a/koperkapel/roaches.py b/koperkapel/roaches.py index b39d189..95353ee 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