File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,29 @@ struct entity : entity_builder<entity>
7777 id_ = ecs_entity_init (world, &desc);
7878 }
7979
80+ /* * Create a named entity.
81+ * Named entities can be looked up with the lookup functions. Entity names
82+ * may be scoped, where each element in the name is separated by sep.
83+ * For example: "Foo.Bar". If parts of the hierarchy in the scoped name do
84+ * not yet exist, they will be automatically created.
85+ *
86+ * @param world The world in which to create the entity.
87+ * @param name The entity name.
88+ * @param sep The separator to use for the scoped name.
89+ * @param root_sep The separator to use for the root of the scoped name.
90+ */
91+ explicit entity (world_t *world, const char *name, const char *sep, const char *root_sep)
92+ : entity_builder()
93+ {
94+ world_ = world;
95+
96+ ecs_entity_desc_t desc = {};
97+ desc.name = name;
98+ desc.sep = sep;
99+ desc.root_sep = root_sep;
100+ id_ = ecs_entity_init (world, &desc);
101+ }
102+
80103 /* * Conversion from flecs::entity_t to flecs::entity.
81104 *
82105 * @param id The entity_t value to convert.
You can’t perform that action at this time.
0 commit comments