-EntityAllocator fixed issue with not initialized block pointer

-deffered adding entities
-deffered adding and removeing components
This commit is contained in:
Mergul 2018-09-17 14:46:30 +02:00
parent b3dce6560a
commit cb0f56b0fb
3 changed files with 214 additions and 77 deletions

View file

@ -120,7 +120,8 @@ int main()
test2.a = 8;
//writeln("Jakis tekst! ",test2.b);
//writeln("Low priority tekst! ");
if(test3)test3.gg = 200;
if (test3)
test3.gg = 200;
}
void handleEvent(Event event, ref TestComp comp)
@ -278,21 +279,23 @@ int main()
gEM.addEntity(tmpl);
gEM.addComponents(entity.id, TestComp3());
pp = gEM.getEntity(entity.id);
gEM.begin();
gEM.update();
gEM.end();
pp = gEM.getEntity(entity.id);
writeln((cast(uint*) pp)[0 .. 14], " ", pp);
gEM.removeComponents!(TestComp)(entity.id);
pp = gEM.getEntity(entity.id);
gEM.begin();
gEM.update();
gEM.end();
pp = gEM.getEntity(entity.id);
writeln((cast(uint*) pp)[0 .. 14], " ", pp);
//import std.stdio;