Everything has been refactored away from engine, which now only controls updating & rendering within a specific timestep. (As well as stepping forward by calling a single update)
Everything regarding grids, patterns and cells has been moved into the simulation and the Services have been updated to reflect that.
Will eventually attach to the Simulation directly without first going through Engine. For now just redirects calls to EngineService to keep functions intact.
All ControlService was used for was a redirection to the engine service. This will be further split up in the future into more logical units of responsibility.
They were used under the old system of every
gridspace being its own cell data structure with its own rules to observe.
Replaced by the RuleSet class. Cell has vanished in favor
of simple boolean values filling the grid.
Simulation updates were one step of calculation and merging the calculations into the map in one function.
Separating the two allows checking for a new update without affecting the grid, allows passing the last Update around and allows custom changes to the grid by passing changes to the merge function that were not derived from the update function.
Cells are now only an empty struct, they carry no information beyond needing to be re-rendered. All Simulation logic is handled in the Simulation Class.
Sets the corresponding element to the parameter value passed in. Checks against the grid size constraints beforehand and throws RangeError if outside of constraints. Preferred method to set
element via coordinates.
Calculates the 2-D array coordinates from the corresponding list index passed in. Relies on grid width to calculate coordinates. Does not check against grid size constraints.