#include "PetComponent.h" #include "MovementAIComponent.h" #include "MissionComponent.h" #include "eMissionState.h" using Pet = PetComponent; using Mission = MissionComponent; using MovementAI = MovementAIComponent; struct Position : NiPoint3 {}; struct Treasure {}; namespace decs { template class System { public: template void each(Fn&& fn) { fn(); } }; class Scene { public: template System system() { return System{}; } }; } void run() { auto scene = decs::Scene{}; scene.system() .each([](Pet& pet) { }); scene.system() .each([](Pet& pet, MovementAI& move) { }); scene.system() .each([](Pet& pet, Mission const& mission, Position const& pos) { auto const digUnlocked = mission.GetMissionState(842) == eMissionState::COMPLETE; auto const treasurePos = PetDigServer::GetClosestTreasure(pos); }); }