bubel-ecs/tests/tests.d
DanielMz25 6217aec6be -changed README
-license changed to BSD (maybe temporary)
-added configurations to dub.json
-initial ECS implementation (WIP):
	-Manager, System, Entity, Component
	-registering components
	-registering systems
	-calling update
2018-09-07 20:54:29 +02:00

69 lines
No EOL
965 B
D

module tests.tests;
import ecs.manager;
import ecs.events;
import ecs.system;
import ecs.entity;
int main()
{
return 0;
}
unittest
{
alias SerializeVector = ubyte[];
struct TestComp
{
__gshared static int component_id;
int a;
ulong b;
static void serializeComponent(ref TestComp comp, SerializeVector output)
{
}
static void deserializeComponent(ref TestComp comp, ubyte[] data)
{
}
}
struct TestSystem
{
void initialize(ref TestComp comp)
{
}
void update()//ref TestComp comp)
{
//comp.a+=1000;
//comp.b+=2000;
import std.stdio;
writeln("Jakis tekst!");
}
void handleEvent(Event event, ref TestComp comp)
{
}
}
EntityManager.initialize();
assert(gEM !is null);
gEM.registerComponent!TestComp;
uint[1] ids = [0];
EntityTemplate* tmpl = gEM.allocateTemplate(ids);
gEM.registerSystem!TestSystem(0);
gEM.update();
}