Encapsulate Ruleset, Patterns in separate Data Structure #53
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
currently patterns are hardcoded in Simulation code to be added to the Simulation grid via function.
Patterns should be contained in a ruleset to be accessed (randomly, or perhaps via enum?)
Ruleset should in turn be contained in the simulation, injected into its creation.
Simulation contains reference to a 'Ruleset' interface (abstract class).
This contains methods for checkSurvival(neighbors, range); checkBirth(neighbors, range);
Ruleset is then implemented in e.g. GameOfLife, which checks for 2/3 and 3 respectively (with range 1 - maybe range should be kept for later)
Rulesets could also contain a list of 'Pattern' objects which is again an interface for simple data objects that describe common/interesting patterns, which could be used to create start configurations in the simulation (by being invoked in Ruleset.createInterestingPattern or something similar) as well as being invoked when clicking the add random pattern button. This should be a separate step and is more involved than the ruleset itself.
created branch
53-encapsulate-ruleset-patterns-in-separate-data-structure
mentioned in merge request !14
assigned to @marty.oehme
closed via commit
b37487a222