-Systems, Components and Events now must have proper mixin. Mixins are located in ecs.core module. (i.e. mixin ECS.Component)

-Multithreading support:
 *multithreaded update - updateMT(), function generates jobs to execute
 *added dispatch callback function to dispatch generated jobs (setJobDispachFunc)
 *added getID callback for get thread ID by EntityManager
-added Job structure. Job has one function "execute()".
-calling partial info update (required to multithreading)
-multithreaded removeEntity, addCompoenents, removeComponents. Every thread has own data and remove/change lists.
-multithreaded addEntity (WIP)
-fixed issue with duplicating components
-simpler and faster "findBlockWithFreeSpace" function
-CallDataAllocator, allocator for CallDatas (used for Jobs)
-fixed some bugs/issues
This commit is contained in:
Mergul 2018-10-14 16:59:46 +02:00
parent 3a767babc0
commit 5dd24b6462
6 changed files with 519 additions and 135 deletions

29
source/ecs/core.d Normal file
View file

@ -0,0 +1,29 @@
module ecs.core;
public import ecs.manager;
static struct ECS
{
mixin template System(uint jobs_count = 32)
{
__gshared ushort system_id;
EntityManager.Job[] _ecs_jobs;
void __ecsInitialize()
{
import std.experimental.allocator.mallocator;
import std.experimental.allocator;
_ecs_jobs = Mallocator.instance.makeArray!(EntityManager.Job)(jobs_count);
}
}
mixin template Component()
{
__gshared ushort component_id;
}
mixin template Event()
{
__gshared ushort event_id;
}
}