Created
March 3, 2018 19:21
-
-
Save ArnCarveris/b84183ef82ae4bb148e629ce009c9374 to your computer and use it in GitHub Desktop.
EnTT entity relationship
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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