Function entity

Summary

#include <include/flecs/addons/cpp/mixins/observer/impl.hpp>

(1) entity()

(2) explicit entity(world_t *world)

(3) explicit entity(const flecs::world_t *world, flecs::id_t id)

(4) explicit entity(world_t *world, const char *name)

(5) explicit entity(entity_t id)

Function overload

Synopsis

#include <include/flecs/addons/cpp/mixins/observer/impl.hpp>

entity()

Description

No description yet.

Source

Lines 13-13 in include/flecs/addons/cpp/entity.hpp. Line 10 in include/flecs/addons/cpp/mixins/observer/impl.hpp.

entity() : entity_builder<entity>() { }

Synopsis

#include <include/flecs/addons/cpp/mixins/observer/impl.hpp>

explicit entity(world_t *world)

Description

Create entity.

Parameters

world - The world in which to create the entity.

Source

Lines 19-24 in include/flecs/addons/cpp/entity.hpp. Line 10 in include/flecs/addons/cpp/mixins/observer/impl.hpp.

explicit entity(world_t *world) 
    : entity_builder() 
{
    m_world = world;
    m_id = ecs_new(world, 0);
}

Synopsis

#include <include/flecs/addons/cpp/mixins/observer/impl.hpp>

explicit entity(const flecs::world_t *world, flecs::id_t id)

Description

Wrap an existing entity id.

Parameters

world - The world in which the entity is created.

id - The entity id.

Source

Lines 31-34 in include/flecs/addons/cpp/entity.hpp. Line 10 in include/flecs/addons/cpp/mixins/observer/impl.hpp.

explicit entity(const flecs::world_t *world, flecs::id_t id) {
    m_world = const_cast<flecs::world_t*>(world);
    m_id = id;
}

Synopsis

#include <include/flecs/addons/cpp/mixins/observer/impl.hpp>

explicit entity(world_t *world, const char *name)

Description

Create a named entity. Named entities can be looked up with the lookup functions. Entity names may be scoped, where each element in the name is separated by "::". For example: "Foo::Bar". If parts of the hierarchy in the scoped name do not yet exist, they will be automatically created.

Parameters

world - The world in which to create the entity.

name - The entity name.

Source

Lines 45-55 in include/flecs/addons/cpp/entity.hpp. Line 10 in include/flecs/addons/cpp/mixins/observer/impl.hpp.

explicit entity(world_t *world, const char *name) 
    : entity_builder()
{ 
    m_world = world;
    ecs_entity_desc_t desc = {};
    desc.name = name;
    desc.sep = "::";
    desc.root_sep = "::";
    m_id = ecs_entity_init(world, &desc);
}

Synopsis

#include <include/flecs/addons/cpp/mixins/observer/impl.hpp>

explicit entity(entity_t id)

Description

Conversion from flecs::entity_t to flecs::entity.

Parameters

id - The entity_t value to convert.

Source

Lines 61-62 in include/flecs/addons/cpp/entity.hpp. Line 10 in include/flecs/addons/cpp/mixins/observer/impl.hpp.

explicit entity(entity_t id) 
    : entity_builder( nullptr, id ) { }