comparison gamelib/products.py @ 3:6ab4f1ab9eab

Very basics of research and products.
author Jeremy Thurgood <firxen@gmail.com>
date Sun, 06 May 2012 11:59:20 +0200
parents
children 826b44731323
comparison
equal deleted inserted replaced
2:427cf79e9875 3:6ab4f1ab9eab
1 from gamelib import research
2
3
4 class Product(object):
5 NAME = None
6 PREREQUISITES = ()
7
8 def __init__(self):
9 self.points = 0
10
11 def spend_points(self, points):
12 self.points += points
13
14
15 class MachineGun(Product):
16 NAME = "Machine gun"
17
18
19 class TeslaGun(Product):
20 NAME = "Tesla gun"
21 PREREQUISITES = (
22 (research.Tesla, 1),
23 )
24
25
26 class DoomsdayVirus(Product):
27 NAME = "Doomsday virus"
28 PREREQUISITES = (
29 (research.BioGenetics, 5),
30 )