public class ComponentTypeFactory extends Object
ComponentType
Modifier and Type | Class and Description |
---|---|
static interface |
ComponentTypeFactory.ComponentTypeListener |
Constructor and Description |
---|
ComponentTypeFactory(ComponentManager cm,
int entityContainerSize) |
Modifier and Type | Method and Description |
---|---|
int |
getIndexFor(Class<? extends Component> c)
Get the index of the component type of given component class.
|
ComponentType |
getTypeFor(Class<? extends Component> c)
Gets the component type for the given component class.
|
ComponentType |
getTypeFor(int index)
Gets component type by index.
|
void |
register(ComponentTypeFactory.ComponentTypeListener listener) |
public ComponentTypeFactory(ComponentManager cm, int entityContainerSize)
public ComponentType getTypeFor(Class<? extends Component> c)
If no component type exists yet, a new one will be created and stored for later retrieval.
c
- the component's class to get the type forComponentType
public ComponentType getTypeFor(int index)
index
- maps to ComponentType
ComponentType
public int getIndexFor(Class<? extends Component> c)
c
- the component class to get the type index forpublic void register(ComponentTypeFactory.ComponentTypeListener listener)
Copyright © 2019. All rights reserved.