bubel-ecs/source/ecs/core.d
Mergul 235bbb49f2 -block allocator now track allocated blocks and is able to free memory
-jobs data is now allocated in System struct
-written memory cleanup (AddressSanitizer don't show any leak)
2019-06-18 16:45:38 +02:00

39 lines
No EOL
795 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;
uint __ecs_jobs_count = jobs_count;
/*EntityManager.Job[] _ecs_jobs;
void __ecsInitialize() nothrow @nogc
{
import std.experimental.allocator.mallocator;
import std.experimental.allocator;
_ecs_jobs = Mallocator.instance.makeArray!(EntityManager.Job)(jobs_count);
}
void __ecsDeinitialize() nothrow @nogc
{
import std.experimental.allocator.mallocator;
import std.experimental.allocator;
Mallocator.instance.dispose(_ecs_jobs);
}*/
}
mixin template Component()
{
__gshared ushort component_id;
}
mixin template Event()
{
__gshared ushort event_id;
EntityID entity_id;
}
}