diff gamelib/schematics.py @ 94:245ef50de84d

Sanity-check research, schematic and mission classes. (Ironic, no?)
author Jeremy Thurgood <firxen@gmail.com>
date Wed, 09 May 2012 21:22:10 +0200
parents c57b5b46d3e0
children ef63532cac13
line wrap: on
line diff
--- a/gamelib/schematics.py	Wed May 09 21:16:53 2012 +0200
+++ b/gamelib/schematics.py	Wed May 09 21:22:10 2012 +0200
@@ -56,6 +56,13 @@
             power += self.POWER_INCREMENT * self.points
         return power
 
+    @classmethod
+    def sanity_check(cls):
+        for science, points in cls.PREREQUISITES:
+            assert issubclass(science, Science)
+            assert isinstance(points, int)
+        assert isinstance(cls.CATEGORIES, tuple)
+
 
 class MachineGun(Schematic):
     NAME = "machine gun"