This commit is contained in:
Marty Oehme 2018-08-23 12:38:34 +02:00
parent 223f831196
commit 6ba0ca55cb
6 changed files with 43 additions and 15 deletions

View file

@ -8,7 +8,15 @@ import 'package:rules_of_living/service/engine_service.dart';
@Component(
selector: 'my-app',
templateUrl: "app_component.html",
directives: [coreDirectives, MaterialButtonComponent, MaterialIconComponent, MaterialSliderComponent, HeaderComponent, SimulationComponent, ControlsComponent],
directives: [
coreDirectives,
MaterialButtonComponent,
MaterialIconComponent,
MaterialSliderComponent,
HeaderComponent,
SimulationComponent,
ControlsComponent
],
providers: [materialProviders, ClassProvider(EngineService)],
styleUrls: const ['package:angular_components/app_layout/layout.scss.css'],
)

View file

@ -6,7 +6,13 @@ import 'package:rules_of_living/src/Engine.dart';
@Component(
selector: 'sim-controls',
templateUrl: "controls_component.html",
directives: [coreDirectives, MaterialButtonComponent, MaterialIconComponent, MaterialSliderComponent, MaterialTooltipDirective],
directives: [
coreDirectives,
MaterialButtonComponent,
MaterialIconComponent,
MaterialSliderComponent,
MaterialTooltipDirective
],
providers: [],
styleUrls: const ["controls_component.css"],
)

View file

@ -4,10 +4,13 @@ import 'package:angular_components/angular_components.dart';
@Component(
selector: 'app_header',
templateUrl: "header_component.html",
directives: [coreDirectives, MaterialButtonComponent, MaterialIconComponent, MaterialSliderComponent],
directives: [
coreDirectives,
MaterialButtonComponent,
MaterialIconComponent,
MaterialSliderComponent
],
providers: [],
styleUrls: const ['package:angular_components/app_layout/layout.scss.css'],
)
class HeaderComponent {
}
class HeaderComponent {}

View file

@ -74,7 +74,12 @@ class Engine {
}
void addPattern(
{CellPattern pattern, int x, int y, int amount, int dispersal, int seed}) {
{CellPattern pattern,
int x,
int y,
int amount,
int dispersal,
int seed}) {
_grid.addPattern(
pattern: pattern,
x: x,

View file

@ -44,7 +44,12 @@ class Grid {
}
void addPattern(
{CellPattern pattern, int x, int y, int amount, int dispersal, int seed}) {
{CellPattern pattern,
int x,
int y,
int amount,
int dispersal,
int seed}) {
_startingSeed = seed ?? DateTime.now().millisecondsSinceEpoch;
math.Random rng = new math.Random(_startingSeed);
_x = x;
@ -212,5 +217,6 @@ class Grid {
_renderEdges = on;
_dirty = true;
}
bool get renderEdges => _renderEdges;
}