X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgame%2Fstage.h;h=80e7a4b72c25e51141d43718c6bed196ffdf712c;hb=f93a0f0afe8aff4d0bbc8ee393918881cfdd9db8;hp=060759696914264ce5c177c0d1674a154b253e52;hpb=248d62f7240d342982ade65a510be912b867fe49;p=libs%2Fgame.git diff --git a/source/game/stage.h b/source/game/stage.h index 0607596..80e7a4b 100644 --- a/source/game/stage.h +++ b/source/game/stage.h @@ -3,18 +3,29 @@ #include #include +#include "eventbus.h" +#include "events.h" +#include "eventsource.h" #include "handle.h" -#include "root.h" namespace Msp::Game { +class Root; class System; class Stage { +public: + using EventSource = Game::EventSource; + private: PoolPool pools; - Root root; + EventBus event_bus; + EventSource event_source; + /* Use unique_ptr because there's only one root per stage so it's pointless + to put it in a pool. */ + std::unique_ptr root; std::vector> systems; public: @@ -22,7 +33,9 @@ public: ~Stage(); PoolPool &get_pools() { return pools; } - Handle get_root() { return Handle::from_object(&root); } + EventBus &get_event_bus() { return event_bus; } + EventSource &get_event_source() { return event_source; } + Handle get_root() { return Handle::from_object(root.get()); } template void iterate_objects(const F &);