Tests added, some function changes
Functions changed to return booleans
This commit is contained in:
parent
b1efb9802d
commit
23abf57b6e
@ -17,13 +17,14 @@ class ComponentManager{
|
||||
Map<Type, Integer> componentPosIndex = new HashMap<>();
|
||||
int componentPos = 0;
|
||||
|
||||
public void registerComponent(Type type){
|
||||
public boolean registerComponent(Type type){
|
||||
if (componentArrays.containsKey(type)){
|
||||
System.err.println("Component " + type.getTypeName() + " is already registered");
|
||||
return;
|
||||
ECS.writeErr("Component " + type.getTypeName() + " is already registered");
|
||||
return false;
|
||||
}
|
||||
componentArrays.put(type, new ComponentArray());
|
||||
componentPosIndex.put(type, componentPos++);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void addComponentToEntity(Type componentName, Object componentData, int entity){
|
||||
|
Loading…
x
Reference in New Issue
Block a user