Decouple Engine and Simulation #55

Closed
opened 2018-10-18 08:54:00 +00:00 by marty-oehme · 6 comments
marty-oehme commented 2018-10-18 08:54:00 +00:00 (Migrated from gitlab.com)

Currently, engine and simulation are tightly coupled to one another. Any operation on the internal simulation (resetting the grid, adding cell patterns, toggling the grid rendering) has to go through the engine right now.

What should be done instead is to have the engine be able to run independently of having a simulation assigned. When a simulation is injected, it will simply run that simulation, calling update and render on it. It should never know more about the simulation than those two simple methods.

Methods that should be kept and reference able: update(), render(), step() [as a single call to update()], toggleEdgeRendering()

Methods that Engine should not know about: reset(), clear(), addPattern(), gridSize

Currently, engine and simulation are tightly coupled to one another. Any operation on the internal simulation (resetting the grid, adding cell patterns, toggling the grid rendering) has to go through the engine right now. What should be done instead is to have the engine be able to run independently of having a simulation assigned. When a simulation is injected, it will simply run that simulation, calling update and render on it. It should never know more about the simulation than those two simple methods. Methods that should be kept and reference able: update(), render(), step() [as a single call to update()], toggleEdgeRendering() Methods that Engine should *not* know about: reset(), clear(), addPattern(), gridSize
marty-oehme commented 2018-10-18 09:54:02 +00:00 (Migrated from gitlab.com)
created branch [`55-decouple-engine-and-simulation`](https://gitlab.com/marty.oehme/cellular-automata/compare/master...55-decouple-engine-and-simulation)
marty-oehme commented 2018-10-18 09:54:03 +00:00 (Migrated from gitlab.com)

mentioned in merge request !15

mentioned in merge request !15
marty-oehme commented 2018-10-18 13:24:00 +00:00 (Migrated from gitlab.com)

mentioned in commit 7e51c2d70a

mentioned in commit 7e51c2d70a275a838aa9f7528be5ed060c8e566b
marty-oehme commented 2018-10-18 13:24:01 +00:00 (Migrated from gitlab.com)

closed via merge request !15

closed via merge request !15
marty-oehme commented 2018-10-19 17:37:34 +00:00 (Migrated from gitlab.com)

mentioned in merge request !16

mentioned in merge request !16
marty-oehme commented 2018-10-19 17:37:56 +00:00 (Migrated from gitlab.com)

mentioned in commit befb345ddd

mentioned in commit befb345ddd0937c655f7f171ed0c110d7244ff0d
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: experiments/cellular-automata#55
No description provided.