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() {
engine.running = false;
engine.addPattern();
}
void onEdgesClicked() {

View File

@ -72,6 +72,17 @@ class Engine {
_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() {
_grid.renderEdges = !_grid.renderEdges;
}