Move Render Methods into SimulationService
This commit is contained in:
parent
58971016da
commit
bbfb2f735b
4 changed files with 14 additions and 13 deletions
|
|
@ -49,6 +49,6 @@ class ConfigurationComponent {
|
|||
ConfigurationComponent(this.engine, this.sim);
|
||||
|
||||
void onEdgesClicked() {
|
||||
engine.toggleGrid();
|
||||
sim.toggleGrid();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import 'dart:html' as html;
|
|||
|
||||
import 'package:angular/angular.dart';
|
||||
import 'package:rules_of_living/service/engine_service.dart';
|
||||
import 'package:rules_of_living/service/simulation_service.dart';
|
||||
|
||||
@Component(
|
||||
selector: 'gol-simulation',
|
||||
|
|
@ -11,8 +12,9 @@ import 'package:rules_of_living/service/engine_service.dart';
|
|||
)
|
||||
class SimulationComponent implements OnInit {
|
||||
final EngineService engine;
|
||||
final SimulationService sim;
|
||||
|
||||
SimulationComponent(this.engine);
|
||||
SimulationComponent(this.engine, this.sim);
|
||||
|
||||
@override
|
||||
void ngOnInit() {
|
||||
|
|
@ -29,6 +31,6 @@ class SimulationComponent implements OnInit {
|
|||
|
||||
the canvas did not load correctly :(
|
||||
''', canvas.width / 2 - 50, canvas.height / 2);
|
||||
engine.canvas = canvas;
|
||||
sim.canvas = canvas;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue