2016-03-04 13:59:43 +00:00
|
|
|
|
|
|
|
#ifndef EC_MANAGER_HPP
|
|
|
|
#define EC_MANAGER_HPP
|
|
|
|
|
2016-03-05 14:33:24 +00:00
|
|
|
#define EC_INIT_ENTITIES_SIZE 1024
|
|
|
|
|
|
|
|
#include <cstddef>
|
|
|
|
#include <tuple>
|
|
|
|
|
|
|
|
#include "Meta/Combine.hpp"
|
|
|
|
#include "Bitset.hpp"
|
|
|
|
|
2016-03-04 13:59:43 +00:00
|
|
|
namespace EC
|
|
|
|
{
|
2016-03-05 14:33:24 +00:00
|
|
|
template <typename ComponentsList, typename TagsList>
|
2016-03-04 13:59:43 +00:00
|
|
|
struct Manager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
using Combined = EC::Meta::Combine<ComponentsList, TagsList>;
|
2016-03-05 14:33:24 +00:00
|
|
|
using BitsetType = EC::Bitset<ComponentsList, TagsList>;
|
|
|
|
|
|
|
|
Manager()
|
|
|
|
{
|
|
|
|
entities.resize(EC_INIT_ENTITIES_SIZE);
|
|
|
|
|
|
|
|
for(auto entity : entities)
|
|
|
|
{
|
|
|
|
entity->first = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename EComponentsList>
|
|
|
|
std::size_t addEntity()
|
|
|
|
{
|
|
|
|
//TODO
|
|
|
|
BitsetType newEntity;
|
|
|
|
return 0;
|
|
|
|
}
|
2016-03-04 13:59:43 +00:00
|
|
|
|
|
|
|
private:
|
2016-03-05 14:33:24 +00:00
|
|
|
using ComponentsStorage = EC::Meta::Morph<ComponentsList, std::tuple<> >;
|
|
|
|
using EntitiesType = std::tuple<bool, BitsetType>;
|
|
|
|
|
|
|
|
std::vector<EntitiesType> entities;
|
2016-03-04 13:59:43 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|