X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgame%2Fdirector.h;h=775d7d2915941a2edb8247a47cddaaceca6277b1;hb=e55354bb994276f83592397899bdf77926e8c769;hp=24ef6341caaf7e93e784ccc7bde1176621ef7e55;hpb=248d62f7240d342982ade65a510be912b867fe49;p=libs%2Fgame.git diff --git a/source/game/director.h b/source/game/director.h index 24ef634..775d7d2 100644 --- a/source/game/director.h +++ b/source/game/director.h @@ -2,9 +2,16 @@ #define MSP_GAME_DIRECTOR_H_ #include +#include #include +#include #include #include +#include "accessguard.h" +#include "eventbus.h" +#include "events.h" +#include "eventsource.h" +#include "reflection.h" namespace Msp::Game { @@ -12,8 +19,17 @@ class Stage; class Director { +public: + using EventSource = Game::EventSource; + private: + std::optional access_guard; + Reflection::Reflector reflector; + DataFile::Collection &resources; + EventBus event_bus; + EventSource event_source; std::vector> stages; + Stage *active_stage = nullptr; Time::TimeStamp last_tick; Time::TimeDelta stepsize = Time::sec/60; Time::TimeDelta backlog; @@ -21,7 +37,17 @@ private: unsigned max_backlog_steps = 600; public: + Director(DataFile::Collection &); + ~Director(); + + DataFile::Collection &get_resources() const { return resources; } + EventBus &get_event_bus() { return event_bus; } + EventSource &get_event_source() { return event_source; } + const std::vector> &get_stages() const { return stages; } + Stage &create_stage(); + void activate_stage(Stage &); + Stage *get_active_stage() const { return active_stage; } void tick(); };