-added function to create EntityTemplate form Entity

This commit is contained in:
Mergul 2019-08-10 16:32:57 +00:00
parent 1be08eb534
commit 9402e917f2
2 changed files with 48 additions and 1 deletions

View file

@ -674,8 +674,14 @@ int main()
//writeln((cast(uint*) pp)[0 .. 14], " ", pp);
writeEntityComponents(gEM.getEntity(entity));
writeln("Entity, its copy, and template, and default filled tempalte");
gEM.addEntity(tmpl);
gEM.addEntityCopy(entity);
writeEntityComponents(gEM.getEntity(entity));
writeEntityComponents(gEM.addEntityCopy(entity));
EntityTemplate* copy_tempalte = gEM.allocateTemplate(entity);
writeEntityComponents(gEM.addEntity(copy_tempalte));
EntityTemplate* copy_default_tempalte = gEM.allocateTemplate(entity,true);
writeEntityComponents(gEM.addEntity(copy_default_tempalte));
gEM.addComponents(entity, TestComp4());
gEM.addComponents(entity, TestComp3());
@ -704,6 +710,8 @@ int main()
//writeln((cast(uint*)tmpl.info.first_block)[0..48]);
gEM.freeTemplate(tmpl);
gEM.freeTemplate(tmpl2);
gEM.freeTemplate(copy_tempalte);
gEM.freeTemplate(copy_default_tempalte);
EntityManager.destroy();
return 0;