Tag Info

Hot answers tagged


The idea is to have spell objects hold some reference to the in-code action you want that spell to do. Python's first-class functions make this quite nice (I'll assume Python 2.7.x): class Spell: def __init__(self, name, description, activationFunction): self.name = name self.description = description self.activationFunction = ...

Only top voted, non community-wiki answers of a minimum length are eligible