X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgame%2Fdirector.cpp;h=53b2e7f9a3a0c8668580a139355133eebe7b3f61;hb=e55354bb994276f83592397899bdf77926e8c769;hp=28d86e7d142e23142839e186b8b4613c6299d8f6;hpb=f90804b7a1042a1266cbe3075631e4fcc18b9a8a;p=libs%2Fgame.git diff --git a/source/game/director.cpp b/source/game/director.cpp index 28d86e7..53b2e7f 100644 --- a/source/game/director.cpp +++ b/source/game/director.cpp @@ -1,19 +1,33 @@ #include "director.h" #include #include +#include "component.h" +#include "entity.h" #include "stage.h" using namespace std; namespace Msp::Game { -Director::Director(): +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()); + stages.emplace_back(std::make_unique(std::ref(reflector), std::ref(resources))); event_source.emit(std::ref(*stages.back())); return *stages.back(); }