X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgame%2Fstage.h;h=19e70f416f54b512087f4560c5c06c9527f185c8;hb=29aa52b23d74d390c677b728776022a9b267d9e6;hp=6af3b60a62596b97d61f833baa0c937c395b063a;hpb=41fa4483d8f017175800992d8fdacd7ee312d0c3;p=libs%2Fgame.git diff --git a/source/game/stage.h b/source/game/stage.h index 6af3b60..19e70f4 100644 --- a/source/game/stage.h +++ b/source/game/stage.h @@ -11,6 +11,7 @@ namespace Msp::Game { +class Camera; class Root; class System; @@ -18,17 +19,19 @@ class Stage { public: using EventSource = Game::EventSource; + Events::ComponentCreated, Events::ComponentDestroyed, Events::CameraChanged>; private: DataFile::Collection &resources; PoolPool pools; EventBus event_bus; EventSource event_source; + EventObserver event_observer; /* 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; + Handle active_camera; public: Stage(DataFile::Collection &); @@ -46,11 +49,15 @@ public: template T &add_system(Args &&...); + void remove_system(System &); const std::vector> &get_systems() const { return systems; } template T *get_system() const; + void set_active_camera(Handle); + Handle get_active_camera() const { return active_camera; } + void tick(Time::TimeDelta); };