From 9ca9d834d9f3aaa0e6bcb026849d1fcae9bf3d93 Mon Sep 17 00:00:00 2001 From: DanielMowitz <53856770+DanielMowitz@users.noreply.github.com> Date: Thu, 19 Sep 2019 13:27:52 +0200 Subject: [PATCH] Update lib.rs --- src/lib.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index cc12cbe..fb239b2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,6 +3,8 @@ extern crate rand; extern crate sdl2; +use dispatcher::Dispatcher; + pub mod dispatcher; pub mod action; pub mod store; @@ -18,8 +20,12 @@ pub mod scene_manager; mod tests; /// "Front-end"-function of the dispatcher -pub fn game_loop<'a>(disp: &'a mut dispatcher::Dispatcher<'a>, store_refs: Vec<&'a mut store::Store<'a>>) { - disp.enter_refs(store_refs); +pub fn game_loop<'a>(mut disp: & mut dispatcher::Dispatcher<'a>, store_refs: Vec<&'a mut store::Store<'a>>) { //todo: HMM + + disp.enter_refs(store_refs); + + while disp.dispatch() {}; + + disp.drop_refs(); - while disp.dispatch() {}; }