Demos #10
2 changed files with 7 additions and 7 deletions
|
|
@ -172,7 +172,7 @@ unittest
|
|||
assert(*entity3.getComponent!CInt == 10);
|
||||
assert(*entity3.getComponent!CFloat == 2.0);
|
||||
|
||||
gEM.addComponents(entity3.id, [CFlag().ref_,CShort(2).ref_]);
|
||||
gEM.addComponents(entity3.id, [CFlag().ref_,CShort(2).ref_].staticArray);
|
||||
gEM.commit();
|
||||
entity3 = gEM.getEntity(id);
|
||||
assert(entity3.getComponent!CInt);
|
||||
|
|
@ -183,7 +183,7 @@ unittest
|
|||
assert(*entity3.getComponent!CFloat == 2.0);
|
||||
assert(*entity3.getComponent!CShort == 2);
|
||||
|
||||
gEM.removeComponents(entity3.id, [CFlag().component_id,CShort(2).component_id]);
|
||||
gEM.removeComponents(entity3.id, [CFlag().component_id,CShort(2).component_id].staticArray);
|
||||
gEM.commit();
|
||||
entity3 = gEM.getEntity(id);
|
||||
assert(entity3.getComponent!CInt);
|
||||
|
|
@ -193,8 +193,8 @@ unittest
|
|||
assert(*entity3.getComponent!CInt == 10);
|
||||
assert(*entity3.getComponent!CFloat == 2.0);
|
||||
|
||||
gEM.addComponents(entity3.id, [CFlag().ref_,CShort(2).ref_]);
|
||||
gEM.removeComponents(entity3.id, [CUnregistered.component_id]);
|
||||
gEM.addComponents(entity3.id, [CFlag().ref_,CShort(2).ref_].staticArray);
|
||||
gEM.removeComponents(entity3.id, [CUnregistered.component_id].staticArray);
|
||||
gEM.commit();
|
||||
entity3 = gEM.getEntity(id);
|
||||
assert(entity3.getComponent!CInt);
|
||||
|
|
@ -211,13 +211,13 @@ unittest
|
|||
|
||||
gEM.endRegister();
|
||||
|
||||
gEM.addComponents(entity3.id, [CUnregistered(4).ref_]);
|
||||
gEM.addComponents(entity3.id, [CUnregistered(4).ref_].staticArray);
|
||||
gEM.commit();
|
||||
entity3 = gEM.getEntity(id);
|
||||
assert(entity3.getComponent!CUnregistered);
|
||||
assert(*entity3.getComponent!CUnregistered == 4);
|
||||
|
||||
gEM.removeComponents(entity3.id, [CUnregistered.component_id]);
|
||||
gEM.removeComponents(entity3.id, [CUnregistered.component_id].staticArray);
|
||||
gEM.commit();
|
||||
entity3 = gEM.getEntity(id);
|
||||
assert(!entity3.getComponent!CUnregistered);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ unittest
|
|||
|
||||
void handleEvent(Entity* entity, Event2 event)
|
||||
{
|
||||
id = gEM.addEntity(tmpl,[CInt(2).ref_, CLong(8).ref_].staticArray).id;
|
||||
id = gEM.addEntity(tmpl).id;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue