|
|
|
@ -40,8 +40,22 @@ pub fn GetSignature(entity: Etyp.entity) Etyp.signature {
|
|
|
|
|
return Signatures[entity];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Component Manager
|
|
|
|
|
//Component Manager variables
|
|
|
|
|
|
|
|
|
|
pub fn RegisterComponent() void {
|
|
|
|
|
|
|
|
|
|
const ComponentTypeList: std.StringArrayHashMap(Etyp.Component) = std.StringArrayHashMap(Etyp.Component);
|
|
|
|
|
|
|
|
|
|
const ComponentArrays: std.StringArrayHashMap(Etyp.ComponentArray) = std.StringArrayHashMap(Etyp.ComponentArray);
|
|
|
|
|
|
|
|
|
|
var NextComponent: Etyp.Component = 0;
|
|
|
|
|
|
|
|
|
|
//component manager
|
|
|
|
|
|
|
|
|
|
pub fn RegisterComponent(in: type) void {
|
|
|
|
|
var name = @typeName(in);
|
|
|
|
|
ComponentTypeList.put(name, NextComponent);
|
|
|
|
|
ComponentArrays.put(name, ComponentArrays{});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn GetComponentArray(in: type) Etyp.ComponentArray {
|
|
|
|
|
return ComponentArrays[@typeName(in)];
|
|
|
|
|
}
|