bubel-ecs/source/ecs/core.d
Mergul 3bc5ff2423 -changes in gitignore
-changed "absent" to "excluded" everywhere
-added Events support:
 *systems are scanned by handleEvent() function
 *generate system callers for events
 *event sending have (untested) multithreaded support
 *EventInput structure in System has input components for event
2018-11-02 15:39:46 +01:00

31 lines
No EOL
559 B
D

module ecs.core;
public import ecs.manager;
public import ecs.entity;
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;
EntityID entity_id;
}
}