X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgame%2Fowned.h;h=19daa7efe12afbbffeb3676d635088daca4889ff;hb=c7d0e1aff305778f97974b329826628966380158;hp=df3cd94f2fde19079742f1a317be059b576e672d;hpb=248d62f7240d342982ade65a510be912b867fe49;p=libs%2Fgame.git diff --git a/source/game/owned.h b/source/game/owned.h index df3cd94..19daa7e 100644 --- a/source/game/owned.h +++ b/source/game/owned.h @@ -3,13 +3,12 @@ #include #include "handle.h" +#include "stage.h" namespace Msp::Game { class Component; class Entity; -class Root; -class Stage; template class Owned: public Handle @@ -68,13 +67,10 @@ template template Stage &Owned::get_stage(O &obj) { - using DependentRoot = std::conditional_t; if constexpr(std::is_base_of_v) return get_stage(*obj.get_entity()); - else if constexpr(std::is_base_of_v) - return dynamic_cast(*obj.get_root()).get_stage(); else - return obj; + return obj.get_stage(); } template