27#include "guillaume/ecs/component.hpp"
28#include "guillaume/ecs/entity.hpp"
67 std::vector<ecs::Entity::Identifier>
69 std::int32_t _layer { 0 };
111 const std::vector<ecs::Entity::Identifier> &
148 std::int32_t
getLayer(
void)
const noexcept;
bool hasParent(void) const noexcept
Check whether the entity has a parent.
bool removeChild(ecs::Entity::Identifier identifier)
Remove an entity from the direct children.
Hierarchy & setParentIdentifier(ecs::Entity::Identifier identifier)
Store the identifier of the parent entity.
std::int32_t getLayer(void) const noexcept
Get the depth of the entity in the tree.
Hierarchy & setLayer(std::int32_t layer)
Store the depth of the entity in the tree.
~Hierarchy(void)=default
Default destructor.
bool hasChild(ecs::Entity::Identifier identifier) const noexcept
Check whether an entity is a direct child of this one.
const std::vector< ecs::Entity::Identifier > & getChildIdentifiers(void) const noexcept
Get the direct children, in the order they were attached.
ecs::Entity::Identifier getParentIdentifier(void) const noexcept
Get the identifier of the parent entity.
bool addChild(ecs::Entity::Identifier identifier)
Append an entity to the direct children.
Hierarchy(void)=default
Construct the hierarchy of a root entity without children.
Base class of every component: a piece of state attached to an entity, plus a "changed" flag.
std::size_t Identifier
The key under which an entity's components are stored. Systems and components refer to entities by th...
static constexpr Identifier InvalidIdentifier
"No entity": never the identifier of a real entity
State. Every class here is plain data attached to an entity.