Skip to content

Instantly share code, notes, and snippets.

@ArnCarveris
Created February 26, 2018 20:03
Show Gist options
  • Save ArnCarveris/4e568aa9abdd39b17f67655ed711662d to your computer and use it in GitHub Desktop.
Save ArnCarveris/4e568aa9abdd39b17f67655ed711662d to your computer and use it in GitHub Desktop.
EnTT scene test
namespace entt
{
template <std::uint64_t Type> class SceneKey
{
public:
static constexpr std::uint64_t type = Type;
std::uint64_t id;
};
template <std::uint64_t Type, typename Entity> class SceneEntity
{
using traits_type = entt_traits<Entity>;
public:
using entity_type = typename traits_type::entity_type;
using scene_key_type = SceneKey<Type>;
scene_key_type scene;
entity_type entity;
};
}
TEST(DefaultRegistry, Scene) {
using ui_scene_key_type = entt::SceneKey<entt::HashedString{"ui"}>;
using ui_scene_entity_type = entt::SceneEntity<entt::HashedString{"ui"},std::uint32_t>;
ui_scene_key_type ui_scene_key{ entt::HashedString{ "options" } };
#if 0 // some example
entt::DefaultRegistry registry;
auto& ui_scene = registry.scene(ui_scene_key);
auto ui_entity = ui_scene.create();
registry.assign<ui_scene_key_type>(ui_entity, ui_scene_key);
registry.assign<ui_scene_entity_type>(ui_entity, entt::HashedString{ "options" }, ui_entity);
#endif
ASSERT_TRUE(true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment