Skip to content

Instantly share code, notes, and snippets.

@ArnCarveris
Created March 3, 2018 19:21
Show Gist options
  • Save ArnCarveris/b84183ef82ae4bb148e629ce009c9374 to your computer and use it in GitHub Desktop.
Save ArnCarveris/b84183ef82ae4bb148e629ce009c9374 to your computer and use it in GitHub Desktop.
EnTT entity relationship
#include <entt/entt_traits.hpp>
#include <vector>
namespace entt
{
template<typename Entity> struct relationship
{
using traits_type = entt_traits<Entity>;
using entity_type = typename traits_type::entity_type;
struct parent
{
entity_type entity;
};
struct group //cluster/chunk/range/siblings
{
entity_type first_entity;
entity_type last_entity;
};
struct link
{
entity_type next_sibling_entity;
entity_type first_child_entity;
};
struct list
{
using list_type = std::vector<entity_type>;
list_type entities;
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment