ChodeGames/chodewars — pull request #27 by matthew-parlette (2013-06-07 19:40:54+00:00)
Title: Entity object to inherit all in-game objects from

This is a big change, more in how to think about the relationship between objects rather than so much the objects themselves.

You can see entity.py is added, which defines Entity. It is pretty basic right now, but defines a standard for which all in-game objects will follow. The major idea is that every object has a parent and (possibly) many children. So the cluster object contains many sectors, sectors can contain ships and planets, ships contain players (and commodities later), players can even contain items for use.

In doing this, the player isn't in a sector anymore, its ship is in a sector and they are in that ship. So if the ship then moves to land on a planet, then the planet contains that ship, but the planet is contained by the sector.

I think this makes sense but let me know if it doesn't. I've done a good amount of testing on this, but there's always a chance I missed something.

To test this, I suggest running a big bang (which should now work for the most part), then starting from scratch, since some of the save and load functions have changed.

This closes #17