-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
This commit is contained in:
parent
8285bde71d
commit
6217aec6be
10 changed files with 265 additions and 11 deletions
|
|
@ -1,5 +1,9 @@
|
|||
module ecs.ecs;
|
||||
|
||||
import std.stdio;
|
||||
|
||||
version(Design):
|
||||
|
||||
alias SytemFuncType = void function(ref SystemCallData data, void* componentsStart);
|
||||
|
||||
struct HasComponentsStore
|
||||
|
|
@ -191,7 +195,7 @@ struct Manager
|
|||
{
|
||||
continue;
|
||||
}
|
||||
entTypeData.systems ~= sys
|
||||
entTypeData.systems ~= sys;
|
||||
}
|
||||
|
||||
return typeData;
|
||||
|
|
@ -215,7 +219,7 @@ struct Manager
|
|||
void systemCaller(ref SystemCallData data, void * componentsStart)
|
||||
{
|
||||
Func(cast(FUnc.par1Type)(componentsStart + data.componentsDt[0]),
|
||||
cast(FUnc.par1Type)(componentsStart + data.componentsDt[1])...);
|
||||
cast(FUnc.par1Type)(componentsStart + data.componentsDt[1])/*...*/);
|
||||
}
|
||||
System* system = new System(&systemCaller, entTypeData);
|
||||
systems ~= system;
|
||||
|
|
@ -267,7 +271,7 @@ class System
|
|||
|
||||
alias SerializeVector = ubyte[];
|
||||
|
||||
__ghsared EntityManager gEntityManager;
|
||||
__gshared EntityManager gEntityManager;
|
||||
|
||||
unittest
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue