X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgame%2Fdirector.cpp;h=53b2e7f9a3a0c8668580a139355133eebe7b3f61;hb=e55354bb994276f83592397899bdf77926e8c769;hp=b06dff4d4c0045c49a98840831071e7845030603;hpb=91e5d4366b857f2441abe7c9a61b6154bd23ea3f;p=libs%2Fgame.git diff --git a/source/game/director.cpp b/source/game/director.cpp index b06dff4..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,7 +12,14 @@ 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() @@ -18,7 +27,7 @@ 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(); }