Release v0.996b - Improved Nu's discrete functional reactive programming model.
Bits of restructuring and refactoring were done to implement more powerful / flexible discrete functional reactive programming (DFRP) in Nu. Now we have the ability to directly propagate an entity's field to the field of another entity, a la Elm (albeit with not quite as nice syntax) -
let world =
world |>
(BobAddress, Entity.getVisible) --> (JimAddress, Entity.setVisible) |>
(JimAddress, Entity.getEnable) --> (BobAddress, not >> Entity.setEnabled)
Here we set up the propagation of Bob's visibility changes to Jim's, and set up the not'd propagation of Jim's enabled state to Bob's.
As said, not the prettiest syntactic form, but does the job in the cases where this type of functionality is needed!
Additionally, there is now an event for changes to the world's state in addition to that of changes of entity's state. Because of that, the camera was moved into the world state so that events apply to its updates as well.
Another change to the world was how all simulants are now stored in a single recursive map, including the game value. If you weren't already, you should now access the game value via the World.getGame function.
Also, there were unrelated, general simplifcations of Nu's API, remarkably the simulant updating and removing functions.
Finally, please note I have not yet provided update events for simulants other than entities, so that will come up very soon. Sorry it didn't make it in time for this release!
Here are the notable changes in detail -
Implement ntoa name-to-address converter. f9ea37c
Playing with DFRP. 79b675f
More work on DfrpExperiment. e6f73b3
More work on DfrpExperiment. 4cb341e
Simplified API for removing simulants from the world. BREAKING CHANGE 55dc34a
Added field getters for simulants. f1b494f
More work on DFRP capabilities. cf36af5
Genericized EntityChangeData to SimulantChangeData. BREAKING CHANGE 7e2a03c
Added genericized simulant Desync functions. ba135b7
Privatized some externally-useless parts of Nu's API. BREAKING CHANGE 6ec600e
Implemented WorldState events. ad02276
Moved Camera field into WorldState. BREAKING CHANGE … 11a0485