From 0ed7c9cd75943b95ee8c93b58cb2829d29ea4cd7 Mon Sep 17 00:00:00 2001 From: sha512sum Date: Sun, 24 Mar 2024 17:52:30 +0000 Subject: [PATCH] Use component names instead types in dependency graph --- include/cserver/engine/components.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/cserver/engine/components.hpp b/include/cserver/engine/components.hpp index 3fda518..4be7b99 100644 --- a/include/cserver/engine/components.hpp +++ b/include/cserver/engine/components.hpp @@ -182,7 +182,7 @@ public: Current, I >{}, - utempl::TypeList>>{} + name >{} > static constexpr auto FindComponent() -> FindComponentType&; @@ -196,21 +196,21 @@ public: Current, I >{}, - utempl::TypeList{} + FindComponentName >{} > static constexpr auto FindComponent() -> T&; - template + template static consteval auto GetDependencies() requires (I == 0 || requires {Magic(loopholes::Getter{}>{});}) { if constexpr(I == 0 && !requires {Magic(loopholes::Getter{}>{});}) { - return utempl::TypeList{}; + return utempl::Tuple{}; } else { - if constexpr(requires{GetDependencies();}) { - return GetDependencies{}>{}))::Type>(); + if constexpr(requires{GetDependencies();}) { + return GetDependencies{}>{}))::Type>(); } else { - return utempl::kTypeList{}>{}))::Type>; + return utempl::Tuple{names..., Magic(loopholes::Getter{}>{})}; }; }; }; @@ -223,7 +223,7 @@ public: } // namespace impl -template +template struct DependencyGraphElement {};