Basic update, multithreading emplate support, fixed
-Added possibility to add entity form template + components to replace template data -basic tests for new functionality -small performance improvement for events -added ComponentRef structure which contain data pointer and component ID -now events are called before entities removing
This commit is contained in:
parent
3d98b0ee5e
commit
15cd57dbcb
6 changed files with 137 additions and 20 deletions
|
|
@ -153,6 +153,14 @@ unittest
|
|||
assert(entity2.getComponent!CFloat);
|
||||
assert(*entity2.getComponent!CInt == 2);
|
||||
assert(*entity2.getComponent!CFloat == 2.0);
|
||||
|
||||
CInt cint = CInt(10);
|
||||
CLong clong;
|
||||
Entity* entity3 = gEM.addEntity(tmpl_, [cint.ref_, clong.ref_].staticArray);
|
||||
assert(entity3.getComponent!CInt);
|
||||
assert(entity3.getComponent!CFloat);
|
||||
assert(*entity3.getComponent!CInt == 10);
|
||||
assert(*entity3.getComponent!CFloat == 2.0);
|
||||
}
|
||||
|
||||
//allocate templates
|
||||
|
|
@ -1142,7 +1150,7 @@ unittest
|
|||
|
||||
entity = gEM.getEntity(id);
|
||||
assert(*entity.getComponent!CLong == 66);
|
||||
assert(*entity.getComponent!CInt == 36);
|
||||
assert(*entity.getComponent!CInt == 2);//36);
|
||||
|
||||
//test for multiple event blocks
|
||||
long result = *entity.getComponent!CLong;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue