Add addPattern Functionality to Engine

This commit is contained in:
Marty Oehme 2018-07-09 17:32:35 +02:00
parent 6745f9c9d6
commit 4c1c805f24
2 changed files with 12 additions and 0 deletions

View file

@ -49,6 +49,7 @@ class AppComponent implements OnInit {
void onRandomClicked() { void onRandomClicked() {
engine.running = false; engine.running = false;
engine.addPattern();
} }
void onEdgesClicked() { void onEdgesClicked() {

View file

@ -72,6 +72,17 @@ class Engine {
_grid.render(canvas, interp); _grid.render(canvas, interp);
} }
void addPattern(
{CellPattern pattern, int x, int y, int amount, int dispersal, int seed}) {
_grid.addPattern(
pattern: pattern,
x: x,
y: y,
amount: amount,
dispersal: dispersal,
seed: seed);
}
void toggleEdgeRendering() { void toggleEdgeRendering() {
_grid.renderEdges = !_grid.renderEdges; _grid.renderEdges = !_grid.renderEdges;
} }