Fix to Meta/Matching
This commit is contained in:
parent
f123f075eb
commit
c6002149d3
3 changed files with 19 additions and 0 deletions
|
@ -12,6 +12,7 @@ namespace EC
|
|||
template <typename TTypeListA, typename TTypeListB>
|
||||
struct MatchingHelper
|
||||
{
|
||||
using type = TypeList<>;
|
||||
};
|
||||
|
||||
template <typename TTypeListA, typename TTypeListB, typename... Matching>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <tuple>
|
||||
#include <EC/Meta/Meta.hpp>
|
||||
#include <EC/EC.hpp>
|
||||
|
@ -102,5 +104,15 @@ TEST(EC, Manager)
|
|||
|
||||
std::size_t edata = std::get<std::size_t>(manager.getEntityInfo(0));
|
||||
EXPECT_EQ(edata, 1);
|
||||
|
||||
std::size_t e2 = manager.addEntity();
|
||||
|
||||
manager.addTag<T0>(e2);
|
||||
|
||||
auto updateTagOnly = [] (std::size_t id) {
|
||||
std::cout << "UpdateTagOnly was run." << std::endl;
|
||||
};
|
||||
|
||||
manager.forMatchingSignature<EC::Meta::TypeList<T0> >(updateTagOnly);
|
||||
}
|
||||
|
||||
|
|
|
@ -227,5 +227,11 @@ TEST(Meta, Matching)
|
|||
bool isSame = std::is_same<ListSome, Matched>::value;
|
||||
EXPECT_TRUE(isSame);
|
||||
}
|
||||
|
||||
{
|
||||
using Matched = EC::Meta::Matching<ListTagsAll, ListComponentsAll>::type;
|
||||
bool isSame = std::is_same<EC::Meta::TypeList<>, Matched>::value;
|
||||
EXPECT_TRUE(isSame);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue