Mercurial > sypikslang
diff 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 diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gamelib/products.py Sun May 06 11:59:20 2012 +0200 @@ -0,0 +1,30 @@ +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), + )