ChodeGames/bitfl — pull request #81 by matthew-parlette (2013-05-11 04:45:39+00:00)
Title: Add major attributes

This is pretty big change to how the attributes are managed for a player.

You should take some time to familiarize yourself with the Attribute class and its subclasses (added to the end of player.py). Each subclass will define calculate, which will eventually serve to figure out the value of an attribute (happiness, for instance) based on its minor attributes (add up your relaxation time and job satisfaction to determine happiness). For now, though, it just returns the value instance variable.

So the two things you should be aware of to use an Attribute is:
* get(), which will call calculate to get the most recent value, and return it
* set(), which takes one of two values

value: set this attribute to this value outright

delta: change the value of this attribute by this value (negative will subtract from this value)

I also added Time as an attribute. This moves it to the player class instead of the game class, which I think makes more sense, but also allows for you to define time used by an item. So if you see the book defined in the library, it will take two hours to use that item, but will provide two happiness.

For examples on this, see the game class, particularly the command processor method, which uses get() and set() throughout. Its a little rough looking to reference the attributes as a dictionary, but it makes the Player.use_item() and Player.info_display() easier to use.