Changed Bitset to use Combined lists
This commit is contained in:
parent
a503eb628d
commit
9c5894520f
1 changed files with 5 additions and 2 deletions
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
#include "Meta/TypeList.hpp"
|
#include "Meta/TypeList.hpp"
|
||||||
|
#include "Meta/Combine.hpp"
|
||||||
|
|
||||||
namespace EC
|
namespace EC
|
||||||
{
|
{
|
||||||
|
@ -11,16 +12,18 @@ namespace EC
|
||||||
struct Bitset :
|
struct Bitset :
|
||||||
public std::bitset<ComponentsList::size + TagsList::size>
|
public std::bitset<ComponentsList::size + TagsList::size>
|
||||||
{
|
{
|
||||||
|
using Combined = EC::Meta::Combine<ComponentsList, TagsList>;
|
||||||
|
|
||||||
template <typename Component>
|
template <typename Component>
|
||||||
constexpr auto getComponentBit()
|
constexpr auto getComponentBit()
|
||||||
{
|
{
|
||||||
return (*this)[EC::Meta::IndexOf<Component, ComponentsList>::value];
|
return (*this)[EC::Meta::IndexOf<Component, Combined>::value];
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Tag>
|
template <typename Tag>
|
||||||
constexpr auto getTagBit()
|
constexpr auto getTagBit()
|
||||||
{
|
{
|
||||||
return (*this)[ComponentsList::size + EC::Meta::IndexOf<Tag, TagsList>::value];
|
return (*this)[EC::Meta::IndexOf<Tag, Combined>::value];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue