comparison gamelib/research.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 23720d0fd9a0
children ef63532cac13
comparison
equal deleted inserted replaced
44:d35a3762edda 45:1e8f7e694f0c
1 class ResearchArea(object): 1 from gamelib.game_base import Science
2 NAME = None 2
3 PREREQUISITES = () 3
4 class ResearchArea(Science):
4 SCIENCE_TYPE = 'research' 5 SCIENCE_TYPE = 'research'
5
6 def __init__(self, points=0):
7 self.points = points
8
9 def spend_point(self):
10 self.points += 1
11
12 def can_spend(self, lab):
13 return True
14 6
15 7
16 class Tesla(ResearchArea): 8 class Tesla(ResearchArea):
17 NAME = "Tesla" 9 NAME = "Tesla"
18 10