-add ecsID template function (get Component/System/Event ID, passes tests)

-removed some ECS mixins code
This commit is contained in:
Mergul 2020-09-29 18:41:31 +02:00
parent 13c82acad4
commit a926b79223
9 changed files with 138 additions and 123 deletions

View file

@ -2,6 +2,18 @@ module bubel.ecs.traits;
import std.traits;
ref ushort ecsID(T)()
{
__gshared ushort id = ushort.max;
return id;
}
ref ushort ecsID(T)(T obj)
{
static if(isPointer!T)return ecsID!(PointerTarget!T);
else return ecsID!T;
}
bool isForeachDelegateWithTypes(DG, Types...)()
{
return is(DG == delegate) && is(ReturnType!DG == int) && is(Parameters!DG == Types);