parent
a92b864dfa
commit
b6919cff6b
3 changed files with 12 additions and 13 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import 'dart:html' as html;
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:rules_of_living/service/engine_service.dart';
|
||||
|
|
@ -9,6 +10,11 @@ class ConfigurationService {
|
|||
|
||||
int _simSpeed;
|
||||
|
||||
ConfigurationService(this._es) {
|
||||
showGrid = false;
|
||||
simSpeed = 5;
|
||||
}
|
||||
|
||||
/// Simulation Speed
|
||||
///
|
||||
/// Sets the number of updates the simulation takes per second. Can range from
|
||||
|
|
@ -20,10 +26,8 @@ class ConfigurationService {
|
|||
_es.engine.stepsPerSecond = simSpeed;
|
||||
}
|
||||
|
||||
ConfigurationService(this._es) {
|
||||
showGrid = false;
|
||||
simSpeed = 5;
|
||||
}
|
||||
void set canvas(html.CanvasElement canvas) => _es.engine.canvas = canvas;
|
||||
html.CanvasElement get canvas => _es.engine.canvas;
|
||||
|
||||
void toggleGrid() {
|
||||
showGrid = !showGrid;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
import 'dart:html' as html;
|
||||
|
||||
import 'package:rules_of_living/service/engine_service.dart';
|
||||
|
||||
class ControlService {
|
||||
|
|
@ -7,9 +5,6 @@ class ControlService {
|
|||
|
||||
ControlService(this._es);
|
||||
|
||||
void set canvas(html.CanvasElement canvas) => _es.engine.canvas = canvas;
|
||||
html.CanvasElement get canvas => _es.engine.canvas;
|
||||
|
||||
void run() {
|
||||
_es.engine.running = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue