bubel-ecs/source/ecs/core.d
Mergul 5dd24b6462 -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
2018-10-14 17:00:53 +02:00

29 lines
No EOL
511 B
D

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;
}
}