X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgame%2Fdirector.cpp;h=53b2e7f9a3a0c8668580a139355133eebe7b3f61;hb=e4f03880d49bdbe0c7269be0f40f23b197bcea77;hp=96bd143dc542b525a66cf61cc16952915b233d8a;hpb=41fa4483d8f017175800992d8fdacd7ee312d0c3;p=libs%2Fgame.git diff --git a/source/game/director.cpp b/source/game/director.cpp index 96bd143..53b2e7f 100644 --- a/source/game/director.cpp +++ b/source/game/director.cpp @@ -1,6 +1,8 @@ #include "director.h" #include #include +#include "component.h" +#include "entity.h" #include "stage.h" using namespace std; @@ -10,11 +12,22 @@ namespace Msp::Game { Director::Director(DataFile::Collection &r): resources(r), event_source(event_bus) +{ +#if DEBUG + access_guard.emplace(); +#endif + + reflector.get_or_create_class().set_polymorphic_base(); + reflector.get_or_create_class().set_polymorphic_base(); +} + +// Hide ~unique_ptr from the header +Director::~Director() { } Stage &Director::create_stage() { - stages.emplace_back(std::make_unique(std::ref(resources))); + stages.emplace_back(std::make_unique(std::ref(reflector), std::ref(resources))); event_source.emit(std::ref(*stages.back())); return *stages.back(); }