Commit graph

182 commits

Author SHA1 Message Date
bdb698394a Re-Order Simulation Class 2018-10-23 21:02:42 +02:00
e40dddde52 Shorten toggleCell Function Name 2018-10-23 21:01:27 +02:00
2e7fd7c3d3 Revert "Add getCell and setCell method to Simulation"
This reverts commit 52b440351d.
2018-10-23 20:58:11 +02:00
52b440351d Add getCell and setCell method to Simulation 2018-10-23 20:41:54 +02:00
5116aff8a4 Refactor toggleCellState function 2018-10-23 20:31:44 +02:00
b1d96efc84 Fix toggleCell Function in Simulation 2018-10-23 20:30:20 +02:00
c8e2417ab8 Remove duplicate functions to set Grid Cells 2018-10-23 20:21:21 +02:00
e840a3e580 Remove unused variable dispersal 2018-10-23 14:47:23 +02:00
474adb740c Split up addRandomPattern function 2018-10-22 19:17:00 +02:00
0b5b1de454 Remove Duplicate Import 2018-10-21 14:06:36 +02:00
cb9da3bc54 Remove unnecessary CellPattern enum from Simulation 2018-10-21 14:01:34 +02:00
3a6e34945a Remove output argument from clearMap function 2018-10-21 14:00:53 +02:00
e115ed2f48 Make clear map function name more concise
Renam resetting the grid to clearMap.
2018-10-21 14:00:22 +02:00
66c273c783 Make Simulation dirty-flag public 2018-10-21 13:55:15 +02:00
1f435617da Re-Enable Simulation dirty-flag test
In preparation for refactoring, and exposing the dirty flag we re-enable the dirty flag test on resetMap
2018-10-21 11:38:57 +02:00
ae26496730 Fix grid resize test to check for object identity 2018-10-21 11:07:46 +02:00
d79aceeebf Merge branch '54-as-a-user-i-want-to-save-and-load-cell-configurations' into 'master'
Resolve "As a user, I want to save and load cell configurations."

Closes #54

See merge request marty.oehme/cellular-automata!17
2018-10-19 18:51:50 +00:00
92e147028e Add Save and Load Buttons to Interface
Fully functional and tested.
2018-10-19 20:51:14 +02:00
22dabda987 Add Save and Load Functions to SimService 2018-10-19 20:50:24 +02:00
2ea974bbd5 Fix Snapshot Load and Save Functions
Were just pointers to the map before. Fix to be actual clones of the map.
2018-10-19 20:49:59 +02:00
37bff59f83 Remove clear function: Code Duplication 2018-10-19 20:01:52 +02:00
0da2d08b74 Add Simulation Saving and Loading Methods 2018-10-19 19:59:00 +02:00
befb345ddd Merge branch '55-decouple-engine-and-simulation' into 'master'
Resolve "Decouple Engine and Simulation"

Closes #55

See merge request marty.oehme/cellular-automata!16
2018-10-19 17:37:55 +00:00
2169de16fd Add Tests to Simulation 2018-10-19 19:35:09 +02:00
e8c1e6ed8b Refactor Engine Methods
Extract method checking for update necessity.
2018-10-19 11:50:34 +02:00
2993b33d9e Add tests for CellPattern & GameOfLife classes 2018-10-19 10:24:40 +02:00
7e51c2d70a Merge branch '55-decouple-engine-and-simulation' into 'master'
Resolve "Decouple Engine and Simulation"

Closes #55

See merge request marty.oehme/cellular-automata!15
2018-10-18 13:23:58 +00:00
8afb45e33e Merge remote-tracking branch 'origin/55-decouple-engine-and-simulation' into 55-decouple-engine-and-simulation 2018-10-18 15:23:10 +02:00
8db9cd6ff1 Move Simulation Accesses to Simulation Class
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.
2018-10-18 15:21:50 +02:00
32a3676d95 Remove deprecated strict mode 2018-10-18 15:19:54 +02:00
bbfb2f735b Move Render Methods into SimulationService 2018-10-18 14:52:03 +02:00
45e8f01acb Move Render Methods into SimulationService 2018-10-18 14:41:57 +02:00
58971016da Remove ConfigurationService
Replaced with direct access to both EngineService and SimulationService.
2018-10-18 14:23:07 +02:00
99ead8691b Make gridSize in Services pass correct signature
Both need to conform to Point<int> to be accepted by the engine.
2018-10-18 12:29:46 +02:00
7729da3a40 Split ConfigurationService to use SimulationService
Methods concerning engine make use of EngineService, those concerning grid and patterns make use of SimulationService.
2018-10-18 12:16:47 +02:00
6b4786fdd0 Add SimulationService to controls
Will eventually attach to the Simulation directly without first going through Engine. For now just redirects calls to EngineService to keep functions intact.
2018-10-18 12:05:02 +02:00
72ce25a806 Rename Controls component variable accessing engine 2018-10-18 11:59:36 +02:00
17697070ee Move ControlService tasks into EngineService
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.
2018-10-18 11:58:38 +02:00
b37487a222 Merge branch '53-encapsulate-ruleset-patterns-in-separate-data-structure' into 'master'
Resolve "Encapsulate Ruleset, Patterns in separate Data Structure"

Closes #53

See merge request marty.oehme/cellular-automata!14
2018-10-18 09:35:12 +00:00
4f92c69a82 Rename Simulation function adding random patterns
Rename from addPattern to addRandomPattern to more clearly signify its purpose.
2018-10-18 11:32:00 +02:00
f1399064a2 Fix Simulation using RuleSet range for neighbor checks 2018-10-18 11:30:14 +02:00
e13962f371 Shorten RuleSet variable for their checked range
Range is self-explanatory and not as confusing as checkRange.
2018-10-18 11:29:55 +02:00
0aa3df30b4 Extract CellPattern and GameOfLife into own files 2018-10-18 11:27:44 +02:00
fbdf114fed Move RuleSet to its own directory 2018-10-18 11:21:18 +02:00
4f63947ab9 Delete unused Cell and Rule Classes
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.
2018-10-18 11:20:41 +02:00
c3244b085e Fix single steps not updating simulation 2018-10-18 11:04:23 +02:00
de1aa46743 Separate Simulation calculating updates and merging
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.
2018-10-18 10:58:06 +02:00
e16085153a Rename Simulation in Engine Object 2018-10-18 09:59:26 +02:00
bac65ef116 Remove unnecessary pattern parameters 2018-10-18 09:57:08 +02:00
6d7120650f Add Special Patterns to RuleSet 2018-10-17 21:08:55 +02:00