Move ControlService tasks into EngineService
All ControlService was used for was a redirection to the engine service. This will be further split up in the future into more logical units of responsibility.
This commit is contained in:
parent
b37487a222
commit
17697070ee
4 changed files with 33 additions and 42 deletions
|
|
@ -1,38 +0,0 @@
|
|||
import 'package:rules_of_living/service/engine_service.dart';
|
||||
|
||||
class ControlService {
|
||||
EngineService _es;
|
||||
|
||||
ControlService(this._es);
|
||||
|
||||
void run() {
|
||||
_es.engine.running = true;
|
||||
}
|
||||
|
||||
void stop() {
|
||||
_es.engine.running = false;
|
||||
}
|
||||
|
||||
void toggleRunning() {
|
||||
_es.engine.running = !_es.engine.running;
|
||||
}
|
||||
|
||||
void step() {
|
||||
_es.engine.step();
|
||||
}
|
||||
|
||||
void reset() {
|
||||
_es.engine.reset();
|
||||
}
|
||||
|
||||
void addRandomPattern() {
|
||||
_es.engine.running = false;
|
||||
_es.engine.addPattern();
|
||||
}
|
||||
|
||||
void clear() {
|
||||
_es.engine.clear();
|
||||
}
|
||||
|
||||
bool get isRunning => _es.engine.running;
|
||||
}
|
||||
|
|
@ -12,4 +12,35 @@ class EngineService {
|
|||
engine = newEngine;
|
||||
return newEngine;
|
||||
}
|
||||
|
||||
void run() {
|
||||
engine.running = true;
|
||||
}
|
||||
|
||||
void stop() {
|
||||
engine.running = false;
|
||||
}
|
||||
|
||||
void toggleRunning() {
|
||||
engine.running = !engine.running;
|
||||
}
|
||||
|
||||
void step() {
|
||||
engine.step();
|
||||
}
|
||||
|
||||
void reset() {
|
||||
engine.reset();
|
||||
}
|
||||
|
||||
void addRandomPattern() {
|
||||
engine.running = false;
|
||||
engine.addPattern();
|
||||
}
|
||||
|
||||
void clear() {
|
||||
engine.clear();
|
||||
}
|
||||
|
||||
bool get isRunning => engine.running;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue