diff gamelib/lab.py @ 45:1e8f7e694f0c

Refactor missions and sciences a bit to reduce duplication.
author Jeremy Thurgood <firxen@gmail.com>
date Mon, 07 May 2012 20:44:27 +0200
parents efc4f90cfd63
children d3d277a42ac6
line wrap: on
line diff
--- a/gamelib/lab.py	Mon May 07 16:53:18 2012 +0200
+++ b/gamelib/lab.py	Mon May 07 20:44:27 2012 +0200
@@ -3,6 +3,7 @@
 from random import random, choice
 
 from gamelib import research, products
+from gamelib.game_base import get_subclasses
 
 
 class Lab(object):
@@ -11,8 +12,8 @@
 
     def __init__(self, init_data=None):
         self.science = []
-        self.new_research = research.ResearchArea.__subclasses__()
-        self.new_products = products.Product.__subclasses__()
+        self.new_research = get_subclasses(research.ResearchArea)
+        self.new_products = get_subclasses(products.Product)
 
         if init_data is not None:
             # Load stored state.