ChodeGames/chodewars — pull request #29 by matthew-parlette (2013-07-02 20:29:36+00:00)
Title: Json save and load

This is the merging of a huge number of changes, so I would check out #27 first, which is a pull request for an earlier state of this.

The major additions/changes:
* Test suite for running automated tests. It is a bit lame to look at, but it gets the job done
* All in-game objects inherit from an entity class, which has the concept of one parent and many children.
* Parents and Children are saved only as strings, to retrieve a parent of an entity, use Game.get_parent(entity)
* Entities have a to_dict method which is used to get a dictionary of fields to save for this object
* All entities only take a dictionary as a parameter (initial_state), so all entities are created in the same way: Entity(initial_state={}), which saves on entity specific code (like clusters, sectors, players).
* FlatFileDatabase now writes and reads json from files when working with the 'database'.
* This helps because it more closely represents a real database, where you will use the Entity.to_dict to get the values to save to any type of database.

To test this, you can run:
```bash
$ python tests.py
```
for automated tests, then start the web session to go through that process:
```bash
$ python chodewars.py
```

Closes #28
Closes #17
Closes #6
Closes #21