Add roach_is_serumless helper.
authorSimon Cross <hodgestar@gmail.com>
Sat, 5 Mar 2016 13:29:03 +0000 (15:29 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sat, 5 Mar 2016 13:29:03 +0000 (15:29 +0200)
koperkapel/serums.py

index c2a52bba6ff0e10525597d2b1a1760108ef95036..40ebfbac59f11950847f662e80906e6107e6c4a7 100644 (file)
@@ -27,6 +27,13 @@ def roach_serum_color(roach):
     return SERUM_OVERLAY_COLORS["none"]
 
 
+def roach_is_serumless(roach):
+    for serum_name in SERUMS:
+        if getattr(roach, serum_name):
+            return False
+    return True
+
+
 class SerumFactory:
     def __init__(self, suffix):
         self.suffix = suffix