| Constructor and Description |
|---|
ComponentMapper() |
| Modifier and Type | Method and Description |
|---|---|
abstract A |
get(Entity e)
Fast but unsafe retrieval of a component for this entity.
|
abstract A |
get(Entity e,
boolean forceNewInstance)
Fast but unsafe retrieval of a component for this entity.
|
static <T extends Component> |
getFor(Class<T> type,
World world)
Returns a component mapper for this type of components.
|
abstract A |
getSafe(Entity e)
Fast and safe retrieval of a component for this entity.
|
abstract A |
getSafe(Entity e,
boolean forceNewInstance)
Fast and safe retrieval of a component for this entity.
|
abstract boolean |
has(Entity e)
Checks if the entity has this type of component.
|
public abstract A get(Entity e) throws ArrayIndexOutOfBoundsException
No bounding checks, so this could throw an
ArrayIndexOutOfBoundsExeption, however in most scenarios you
already know the entity possesses this component.
e - the entity that should possess the componentArrayIndexOutOfBoundsExceptionpublic abstract A get(Entity e, boolean forceNewInstance) throws ArrayIndexOutOfBoundsException
No bounding checks, so this could throw an
ArrayIndexOutOfBoundsExeption, however in most scenarios you
already know the entity possesses this component.
e - the entity that should possess the componentforceNewInstance - Returns a new instance of the component (only applies to PackedComponents)ArrayIndexOutOfBoundsExceptionpublic abstract A getSafe(Entity e)
If the entity does not have this component then null is returned.
e - the entity that should possess the componentpublic abstract A getSafe(Entity e, boolean forceNewInstance)
If the entity does not have this component then null is returned.
e - the entity that should possess the componentforceNewInstance - If true, returns a new instance of the component (only applies to PackedComponents)public abstract boolean has(Entity e)
e - the entity to checkpublic static <T extends Component> ComponentMapper<T> getFor(Class<T> type, World world)
T - the class type of componentstype - the class of components this mapper usesworld - the world that this component mapper should useCopyright © 2014. All Rights Reserved.