Fix single steps not updating simulation
This commit is contained in:
parent
de1aa46743
commit
c3244b085e
1 changed files with 1 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue