Fix single steps not updating simulation

This commit is contained in:
Unknown 2018-10-18 11:04:23 +02:00
parent de1aa46743
commit c3244b085e

View file

@ -101,7 +101,6 @@ class Engine {
/// directly, since it is automatically taken care of by the processing function. /// directly, since it is automatically taken care of by the processing function.
/// If simulation should be advanced manually one time, prefer using step(). /// If simulation should be advanced manually one time, prefer using step().
void update() { void update() {
// TODO: create hasUpdated/hasAdvanced method in simulation to abstract actual updating away
Map<int, bool> simulationUpdate = _simulation.update(); Map<int, bool> simulationUpdate = _simulation.update();
_simulation.mergeStateChanges(simulationUpdate); _simulation.mergeStateChanges(simulationUpdate);
@ -114,8 +113,8 @@ class Engine {
/// simulation. Does not automatically re-render the new state /// simulation. Does not automatically re-render the new state
/// (though this should usually not pose a problem). /// (though this should usually not pose a problem).
void step() { void step() {
update();
running = false; running = false;
_simulation.update();
} }
/// Renders the Current Simulation State /// Renders the Current Simulation State