Mercurial > sypikslang
view 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 |
line wrap: on
line source
from gamelib import research class Product(object): NAME = None PREREQUISITES = () def __init__(self): self.points = 0 def spend_points(self, points): self.points += points class MachineGun(Product): NAME = "Machine gun" class TeslaGun(Product): NAME = "Tesla gun" PREREQUISITES = ( (research.Tesla, 1), ) class DoomsdayVirus(Product): NAME = "Doomsday virus" PREREQUISITES = ( (research.BioGenetics, 5), )