Take UUID table as argument for ECS creation
The ECS needs a UUID table to get UUIDs for the entities. If none is given into the creation function, it will create one itself.
This commit is contained in:
parent
a6595f584c
commit
a8c941f041
|
@ -16,7 +16,7 @@ struct vecs_entity
|
||||||
vx_uuid_d uuid;
|
vx_uuid_d uuid;
|
||||||
};
|
};
|
||||||
|
|
||||||
vecs_s * vecs_new();
|
vecs_s * vecs_new(vx_uuid_table_s *uuid_table);
|
||||||
void vecs_free(vecs_s *ecs);
|
void vecs_free(vecs_s *ecs);
|
||||||
|
|
||||||
vecs_entity_s vecs_summon(vecs_s *ecs);
|
vecs_entity_s vecs_summon(vecs_s *ecs);
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
|
|
||||||
vecs_s * vecs_new(vx_uuid_table_s *uuid_table)
|
vecs_s * vecs_new(vx_uuid_table_s *uuid_table)
|
||||||
{
|
{
|
||||||
|
if( ! uuid_table)
|
||||||
|
{
|
||||||
|
uuid_table = vx_new_uuid_table();
|
||||||
|
}
|
||||||
vecs_s *ecs = malloc(sizeof(vecs_s));
|
vecs_s *ecs = malloc(sizeof(vecs_s));
|
||||||
ecs->resolver = vecs_create_tag_name_resolver(uuid_table);
|
ecs->resolver = vecs_create_tag_name_resolver(uuid_table);
|
||||||
ecs->lookup_map = vecs_create_lookup_map(uuid_table);
|
ecs->lookup_map = vecs_create_lookup_map(uuid_table);
|
||||||
|
|
Loading…
Reference in New Issue