Add addPattern Functionality to Engine
This commit is contained in:
parent
6745f9c9d6
commit
4c1c805f24
2 changed files with 12 additions and 0 deletions
|
@ -49,6 +49,7 @@ class AppComponent implements OnInit {
|
||||||
|
|
||||||
void onRandomClicked() {
|
void onRandomClicked() {
|
||||||
engine.running = false;
|
engine.running = false;
|
||||||
|
engine.addPattern();
|
||||||
}
|
}
|
||||||
|
|
||||||
void onEdgesClicked() {
|
void onEdgesClicked() {
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue