jmmk / clash-attack-sim

https://jmmk.github.io/clash-attack-sim/
Other
3 stars 1 forks source link

Register systems instead of hardcoding a list of systems to run #9

Closed jmmk closed 9 years ago

jmmk commented 9 years ago

This would also allow adding/removing systems dynamically during execution

jmmk commented 9 years ago

A big consideration is the ordering - the systems need to run in an exact order unless another method of dependency resolution is implemented.

I like the idea that all of the systems are independent and only look at a state, but I think some of them are actually coupled together by things like "attacked this frame", so there may be some refactoring to clean it up a little bit.

jmmk commented 9 years ago

Added the ability to add a system, but currently they run in the order returned by:

(vals (:systems world))

Could use a priority map like https://github.com/bakpakin/ezglib/blob/master/src/ezglib/core.cljs, or check out https://github.com/quile/dependency-cljs