#include <memory>
#include <msp/time/timedelta.h>
+#include "eventbus.h"
+#include "events.h"
+#include "eventsource.h"
#include "handle.h"
namespace Msp::Game {
class Stage
{
+public:
+ using EventSource = Game::EventSource<Events::EntityCreated, Events::EntityDestroyed,
+ Events::ComponentCreated, Events::ComponentDestroyed>;
+
private:
PoolPool pools;
+ 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> root;
~Stage();
PoolPool &get_pools() { return pools; }
+ EventBus &get_event_bus() { return event_bus; }
+ EventSource &get_event_source() { return event_source; }
Handle<Root> get_root() { return Handle<Root>::from_object(root.get()); }
template<typename T, typename F>