From ac9a7c759193a1aa3ca01b9da61b61c148376970 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 9 Jul 2018 17:27:56 +0200 Subject: [PATCH] Implement Engine Step Method --- lib/app_component.dart | 3 +-- lib/src/Engine.dart | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/app_component.dart b/lib/app_component.dart index 9f97ef0..7c3d314 100644 --- a/lib/app_component.dart +++ b/lib/app_component.dart @@ -39,8 +39,7 @@ class AppComponent implements OnInit { } void onStepClicked() { - engine.running = false; - engine.update(); + engine.step(); } void onResetClicked() { diff --git a/lib/src/Engine.dart b/lib/src/Engine.dart index cc59f96..a737758 100644 --- a/lib/src/Engine.dart +++ b/lib/src/Engine.dart @@ -60,6 +60,10 @@ class Engine { void update() { // print("updating"); if(!grid.update()) running = false; + + void step() { + running = false; + _grid.update(); } void render([num interp]) {