added empty<Comp> to the registry
This commit is contained in:
@@ -256,6 +256,11 @@ public:
|
||||
return available.size() == count;
|
||||
}
|
||||
|
||||
template<typename Comp>
|
||||
bool empty() const noexcept {
|
||||
return pool.template empty<Comp>();
|
||||
}
|
||||
|
||||
entity_type create() noexcept {
|
||||
entity_type entity;
|
||||
|
||||
|
||||
@@ -10,9 +10,15 @@ TEST(DefaultRegistry, Functionalities) {
|
||||
ASSERT_EQ(registry.capacity(), registry_type::size_type{0});
|
||||
ASSERT_TRUE(registry.empty());
|
||||
|
||||
ASSERT_TRUE(registry.empty<int>());
|
||||
ASSERT_TRUE(registry.empty<char>());
|
||||
|
||||
registry_type::entity_type e1 = registry.create();
|
||||
registry_type::entity_type e2 = registry.create<int, char>();
|
||||
|
||||
ASSERT_FALSE(registry.empty<int>());
|
||||
ASSERT_FALSE(registry.empty<char>());
|
||||
|
||||
ASSERT_NE(e1, e2);
|
||||
|
||||
ASSERT_FALSE(registry.has<int>(e1));
|
||||
|
||||
Reference in New Issue
Block a user