From c6002149d3ccaf968c3c7ab70ae4f4ad8790a06f Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Sun, 13 Mar 2016 18:17:06 +0900 Subject: [PATCH] Fix to Meta/Matching --- src/EC/Meta/Matching.hpp | 1 + src/test/ECTest.cpp | 12 ++++++++++++ src/test/MetaTest.cpp | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/src/EC/Meta/Matching.hpp b/src/EC/Meta/Matching.hpp index e2e5a78..8b525f9 100644 --- a/src/EC/Meta/Matching.hpp +++ b/src/EC/Meta/Matching.hpp @@ -12,6 +12,7 @@ namespace EC template struct MatchingHelper { + using type = TypeList<>; }; template diff --git a/src/test/ECTest.cpp b/src/test/ECTest.cpp index aa546b3..a881d97 100644 --- a/src/test/ECTest.cpp +++ b/src/test/ECTest.cpp @@ -1,6 +1,8 @@ #include +#include + #include #include #include @@ -102,5 +104,15 @@ TEST(EC, Manager) std::size_t edata = std::get(manager.getEntityInfo(0)); EXPECT_EQ(edata, 1); + + std::size_t e2 = manager.addEntity(); + + manager.addTag(e2); + + auto updateTagOnly = [] (std::size_t id) { + std::cout << "UpdateTagOnly was run." << std::endl; + }; + + manager.forMatchingSignature >(updateTagOnly); } diff --git a/src/test/MetaTest.cpp b/src/test/MetaTest.cpp index 0f34fe1..6dcf850 100644 --- a/src/test/MetaTest.cpp +++ b/src/test/MetaTest.cpp @@ -227,5 +227,11 @@ TEST(Meta, Matching) bool isSame = std::is_same::value; EXPECT_TRUE(isSame); } + + { + using Matched = EC::Meta::Matching::type; + bool isSame = std::is_same, Matched>::value; + EXPECT_TRUE(isSame); + } }