Added Entity class, which everything else will inherit from.
Moved Cluster class to inherit from Entity and tested.

Also moved __cmp__ from cluster to entity since it compares on the name, and that should be the default.
Moved Sector to inherit from Entity.

I also changed most of the code (all that I could find) to use Sector.name instead of Sector.id. I tested it and it works fine so far.
Merge branch 'master' into we_heard_you_like_inheritance
Moved Planet to inherit from Entity.
Changed Ship to use Entity.
Moved Player to use Entity.

This required a lot of reworking, since with the idea of everything inheriting from entity, the player is a child of the ship, so when you issue a move command, you are moving the ship, not the player itself.

There was some changes to how the links appear for moving the ship on the web page, so the cluster is now included in there. It looks like a lot of text right now, so this will need to be worked on to get it looking cleaner.

This also adds load_object in Game, which will be expanded, and likely added to Database as well.
Resolved issues in creating a new player.

This changes the flow of creating a new player, after the player is created, then the ship will be created, then the planet/home sector. This is because the ship now determines where the player is, not the player object itself.

I also removed the cluster and sector from the player file for the same reasons as above.
Implemented Entity.to_dict().

This returns a dictionary for every instance variable in the class, and converts the parent and child objects to only return their ids. (If it returned the children objects, then the Cluster.to_dict() would return every object in the game)

I removed the Player.to_dict() since it is less advanced than the Entity.to_dict() function, and I tested the inherited Player.to_dict() and it worked as expected.
Added Test and Action classes along with two simple tests.

I don't like how Action is very hands-on when you need to add a new action in, but we'll have to work on that later.
Added a step in add player to also assign an home sector for that player.
Finished action to load player.
Merge branch 'automated_tests' into json_save_and_load
A shamefully monstrous commit.

This contains a ton of fixes as made light by adding the testing functions. It vastly simplifies the database operations by removing the object specific get and add functions (get_sector, add_sector) and use load_object and save_object instead.

There are also a bunch of fixes to the game, player, and cluster objects, with more to come to others as more tests are written.
Simplify the init method of Entity objects.

This uses an initial_state dictionary that defines any fields that need to be set for this entity. This will change the way these objects are created, but will simplify the creation of objects that are loaded from the database.

Currently only the Entity, Cluster, Sector, and Player objects are modified and tested, more to come later.

This also fixes the big bang by adding a bigbang parameter to the Game.__init__ method. Before, the game would try to initialize the clusters before the big bang could be called.
Convert Planet and Ship to new init method.

Now all current entity types can be loaded from the _read_json method

This also adds functions to the Game object to get parent and get children objects to load from the database (or later from the cache), as well as assigning a child object to a parent.

Using these new methods, this modifies the get player test to make sure the ship is created and child objects are property assigned (player is a child of ship, ship is a child of sector).
Added a check when adding a player or assigning a home sector so these are skipped if these already exist.
Added test to move a ship and fixed associated issues.

Fixed loading of sectors by name, since this has to include the cluster name in the search term.
Fixed Game.assign_child to remove current parent if it exists.
Fixed Game.get_available_warps to use get_parent instead of referencing parent object directly.
Fixed Game.move_ship to work properly with entities.
Correctly implemented Entity.remove_child, since the list.remove method does NOT return anything (as I thought it returned a boolean).
Got the web site working again.

Removed Game.build_ship because it is unused.
Fixed the AddHandler.post method to call updated Game methods.
Moved ship name to be a part of creating a home sector in AddHandler.
Removed /add/ship support, since it is not required anymore.
Added Game.load_object_by_id.
Changed /c/move to provide a sector id which will be more easily loaded (by id rather than cluster-sector names).
Modified CommandHandler to correctly accept the move command.
Fixed Entity.__init__ to correctly handle when self.parent is loaded from the json file as "None", it now converts to a true python None (which fixes the assign_home_sector, which skipped creating a home sector if the player had a parent which was not None).
Merge pull request #29 from ChodeGames/json_save_and_load

Json save and load