Skip to content

Commit 6f2eed6

Browse files
authored
Update distr
1 parent edb2bc7 commit 6f2eed6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

distr/flecs.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26077,6 +26077,29 @@ struct entity : entity_builder<entity>
2607726077
id_ = ecs_entity_init(world, &desc);
2607826078
}
2607926079

26080+
/** Create a named entity.
26081+
* Named entities can be looked up with the lookup functions. Entity names
26082+
* may be scoped, where each element in the name is separated by sep.
26083+
* For example: "Foo.Bar". If parts of the hierarchy in the scoped name do
26084+
* not yet exist, they will be automatically created.
26085+
*
26086+
* @param world The world in which to create the entity.
26087+
* @param name The entity name.
26088+
* @param sep The separator to use for the scoped name.
26089+
* @param root_sep The separator to use for the root of the scoped name.
26090+
*/
26091+
explicit entity(world_t *world, const char *name, const char *sep, const char *root_sep)
26092+
: entity_builder()
26093+
{
26094+
world_ = world;
26095+
26096+
ecs_entity_desc_t desc = {};
26097+
desc.name = name;
26098+
desc.sep = sep;
26099+
desc.root_sep = root_sep;
26100+
id_ = ecs_entity_init(world, &desc);
26101+
}
26102+
2608026103
/** Conversion from flecs::entity_t to flecs::entity.
2608126104
*
2608226105
* @param id The entity_t value to convert.

0 commit comments

Comments
 (0)