seanfisk/ecs — pull request #6 by ponderstibbons (2014-03-14 16:28:14+00:00)
Title: add priority keyword to `add_system()` method

Add a `priority` attribute to `ecs.models.Systems` and sort
`ecs.managers.SystemManager._systems` by it every time a system is added.
Also add a new test case to ensure that system with the same priority
end up being executed in the order they were added and adjust
`test_systems_added` and `test_remove_system`.

The overhead introduced by the sorting should not be that high, given that Timsort should deal pretty well with partially sorted lists, but I haven't done any benchmarks. The changes to the tests I made may seem blunt as I am unfamiliar with most of the libraries you use there.