]> git.tdb.fi Git - libs/game.git/blobdiff - source/game/director.h
Decorate things which constitute the public API of the library
[libs/game.git] / source / game / director.h
index 9d221b0678345a8def4c06b5936c3bee95ebe865..5aeddea932badd73b41d9f5aa56b2e4669c24a44 100644 (file)
@@ -2,23 +2,31 @@
 #define MSP_GAME_DIRECTOR_H_
 
 #include <memory>
+#include <optional>
 #include <vector>
+#include <msp/datafile/collection.h>
 #include <msp/time/timedelta.h>
 #include <msp/time/timestamp.h>
+#include "accessguard.h"
 #include "eventbus.h"
 #include "events.h"
 #include "eventsource.h"
+#include "mspgame_api.h"
+#include "reflection.h"
 
 namespace Msp::Game {
 
 class Stage;
 
-class Director
+class MSPGAME_API Director
 {
 public:
        using EventSource = Game::EventSource<Events::StageCreated, Events::StageActivated, Events::StageDeactivated>;
 
 private:
+       std::optional<AccessGuard> access_guard;
+       Reflection::Reflector reflector;
+       DataFile::Collection &resources;
        EventBus event_bus;
        EventSource event_source;
        std::vector<std::unique_ptr<Stage>> stages;
@@ -30,9 +38,17 @@ private:
        unsigned max_backlog_steps = 600;
 
 public:
-       Director();
+       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<std::unique_ptr<Stage>> &get_stages() const { return stages; }
+
        Stage &create_stage();
        void activate_stage(Stage &);
+       Stage *get_active_stage() const { return active_stage; }
 
        void tick();
 };