Mostly bugfix update + empty components support and remove EntityID from Event structure

-empty components now take no memory, so flag components is now far better
-added test for critical bug
-fixed critical bug with adding/removing entities form inside events
-fixed small bug with TestRunner
-improve basic tests
-fixed betterC compilation on DMD
-remove EntityID form Event structure
-added "return" attribute to some functions
-moved some code from Tempalte side to actual implementation
-fixed bug with EntityTemplate copying
-commented out some possibliy unused code
-use code formatter
This commit is contained in:
Mergul 2020-05-27 17:03:44 +02:00
parent 15cd57dbcb
commit 6929f5a748
16 changed files with 988 additions and 544 deletions

View file

@ -75,19 +75,18 @@ static struct ECS
{
__gshared ushort component_id = ushort.max;
ComponentRef ref_() @nogc nothrow
ComponentRef ref_() @nogc nothrow return
{
return ComponentRef(&this,component_id);
return ComponentRef(&this, component_id);
}
}
/************************************************************************************************************************
Mark structure as Event. Should be added on top of structure (before any data).
*/
mixin template Event()
mixin template Event()
{
__gshared ushort event_id = ushort.max;
EntityID entity_id;
}
/************************************************************************************************************************
@ -113,4 +112,4 @@ static struct ECS
{
alias WritableDependencies = T;
}
}
}