#!/usr/bin/env python from statMechanics import * class Level(PrimitiveStat): pass class Str(CompoundStat): pass class AttackPower(CompoundStat): pass stats = StatCollection() level = Level() str = Str() base_attack_power = CalculatedStat(lambda: (level.value * 2) + str.value, [level,str]) attack_power = AttackPower(base_attack_power) level.set(1) attack_power.addToStatCollection(stats) print attack_power.value a = AttackPower.Adder(43) stats.apply(a) print attack_power.value # would like to be able to do it this way #b = AttackPower + 43 #stats.apply(b)