From a36b61136726dc05e4cd102593419503a873643e Mon Sep 17 00:00:00 2001 From: jadebenn Date: Tue, 24 Dec 2024 00:41:37 -0600 Subject: [PATCH] conceptualizing --- dECS/CMakeLists.txt | 1 + dECS/System.cpp | 52 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 dECS/System.cpp diff --git a/dECS/CMakeLists.txt b/dECS/CMakeLists.txt index c100db7e..f5dce280 100644 --- a/dECS/CMakeLists.txt +++ b/dECS/CMakeLists.txt @@ -5,6 +5,7 @@ add_library(dECS STATIC "Core.h" "Iter.h" "Core.cpp" + "System.cpp" ) target_include_directories(dECS PUBLIC .) target_link_libraries(dECS PRIVATE dCommon magic_enum::magic_enum) diff --git a/dECS/System.cpp b/dECS/System.cpp new file mode 100644 index 00000000..88ea1f7f --- /dev/null +++ b/dECS/System.cpp @@ -0,0 +1,52 @@ +#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); + + + }); +}