-changes in EntityAlocator

* renamed to BlockAllocator
 * now it's template with compile time assingable block_size and block_in_allocation variables
-WIP Event management
 * probably working sendSelfEvent()
 * registerEvent()
-added win_dll.d as Windows DLL require functionality
This commit is contained in:
Mergul 2018-09-19 17:50:05 +02:00
parent d0fcdba6cd
commit 4ad81fe116
6 changed files with 264 additions and 57 deletions

View file

@ -10,6 +10,19 @@ import std.stdio;
int main()
{
struct TestEvent
{
__gshared ushort event_id;
int a;
}
struct TestEvent2
{
__gshared ushort event_id;
float a;
}
struct TestComp
{
__gshared ushort component_id;
@ -124,7 +137,7 @@ int main()
test3.gg = 200;
}
void handleEvent(Event event, ref TestComp comp)
void handleEvent(TestEvent event, ref TestComp test, ref TestComp2 test2, TestComp3* test3)
{
}
@ -145,10 +158,10 @@ int main()
//writeln("High priority tekst! ");
}
void handleEvent(Event event, ref TestComp comp)
/*void handleEvent(Event event, ref TestComp comp)
{
}
}*/
}
struct TestSystem2
@ -177,12 +190,13 @@ int main()
{
//writeln("TestSystem2 update");
test.gg += 14;
gEM.sendSelfEvent!(TestEvent)(entity.id, TestEvent());
}
void handleEvent(Event event, ref TestComp comp)
/*void handleEvent(Event event, ref TestComp comp)
{
}
}*/
}
EntityManager.initialize();
@ -195,6 +209,9 @@ int main()
gEM.registerComponent!TestComp;
gEM.registerComponent!TestComp3;
gEM.registerEvent!TestEvent;
gEM.registerEvent!TestEvent2;
ulong dur = (MonoTime.currTime - time).total!"usecs";
writeln("Components register: ", dur, " usecs");
@ -288,7 +305,7 @@ int main()
writeln((cast(uint*) pp)[0 .. 14], " ", pp);
gEM.removeComponents!(TestComp)(entity.id);
//gEM.removeComponents!(TestComp)(entity.id);
gEM.begin();
gEM.update();