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:
Eric-Paul Ickhorn 2024-09-14 14:25:49 +02:00
parent a6595f584c
commit a8c941f041
2 changed files with 5 additions and 1 deletions

View File

@ -16,7 +16,7 @@ struct vecs_entity
vx_uuid_d uuid;
};
vecs_s * vecs_new();
vecs_s * vecs_new(vx_uuid_table_s *uuid_table);
void vecs_free(vecs_s *ecs);
vecs_entity_s vecs_summon(vecs_s *ecs);

View File

@ -5,6 +5,10 @@
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));
ecs->resolver = vecs_create_tag_name_resolver(uuid_table);
ecs->lookup_map = vecs_create_lookup_map(uuid_table);