Move Simulation Accesses to Simulation Class

Everything has been refactored away from engine, which now only controls updating & rendering within a specific timestep. (As well as stepping forward by calling a single update)

Everything regarding grids, patterns and cells has been moved into the simulation and the Services have been updated to reflect that.
This commit is contained in:
Unknown 2018-10-18 15:21:50 +02:00
parent 32a3676d95
commit 8db9cd6ff1
5 changed files with 33 additions and 63 deletions

View file

@ -1,4 +1,5 @@
import 'package:rules_of_living/src/Engine.dart';
import 'package:rules_of_living/src/Simulation.dart';
class EngineService {
Engine _uncachedEngineAccess;
@ -41,18 +42,7 @@ class EngineService {
int get simSpeed => engine.stepsPerSecond;
void set simSpeed(int val) => engine.stepsPerSecond = val;
void reset() {
engine.reset();
}
void addRandomPattern() {
engine.running = false;
engine.addPattern();
}
void clear() {
engine.clear();
}
bool get isRunning => engine.running;
void set simulation(Simulation value) => engine.simulation = value;
}