|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.artemis.Entity
public final class Entity
The entity class. Cannot be instantiated outside the framework, you must create new entities using World.
| Constructor Summary | |
|---|---|
protected |
Entity(World world,
int id)
|
| Method Summary | ||
|---|---|---|
Entity |
addComponent(Component component)
Add a component to this entity. |
|
Entity |
addComponent(Component component,
ComponentType type)
Faster adding of components into the entity. |
|
void |
addToWorld()
Refresh all changes to components for this entity. |
|
void |
changedInWorld()
This entity has changed, a component added or deleted. |
|
void |
deleteFromWorld()
Delete this entity from the world. |
|
void |
disable()
Disable the entity from being processed. |
|
void |
enable()
(Re)enable the entity in the world, after it having being disabled. |
|
|
getComponent(java.lang.Class<T> type)
Slower retrieval of components from this entity. |
|
Component |
getComponent(ComponentType type)
This is the preferred method to use when retrieving a component from a entity. |
|
protected java.util.BitSet |
getComponentBits()
Returns a BitSet instance containing bits of the components the entity possesses. |
|
Bag<Component> |
getComponents(Bag<Component> fillBag)
Returns a bag of all components this entity has. |
|
int |
getId()
The internal id for this entity within the framework. |
|
protected java.util.BitSet |
getSystemBits()
Returns a BitSet instance containing bits of the components the entity possesses. |
|
java.util.UUID |
getUuid()
Get the UUID for this entity. |
|
World |
getWorld()
Returns the world this entity belongs to. |
|
boolean |
isActive()
Checks if the entity has been added to the world and has not been deleted from it. |
|
boolean |
isEnabled()
Will check if the entity is enabled in the world. |
|
Entity |
removeComponent(java.lang.Class<? extends Component> type)
Remove component by its type. |
|
Entity |
removeComponent(Component component)
Removes the component from this entity. |
|
Entity |
removeComponent(ComponentType type)
Faster removal of components from a entity. |
|
protected void |
reset()
Make entity ready for re-use. |
|
java.lang.String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected Entity(World world,
int id)
| Method Detail |
|---|
public int getId()
protected java.util.BitSet getComponentBits()
protected java.util.BitSet getSystemBits()
protected void reset()
public java.lang.String toString()
toString in class java.lang.Objectpublic Entity addComponent(Component component)
component - to add to this entity
public Entity addComponent(Component component,
ComponentType type)
component - the component to addtype - of the component
public Entity removeComponent(Component component)
component - to remove from this entity.
public Entity removeComponent(ComponentType type)
component - to remove from this entity.
public Entity removeComponent(java.lang.Class<? extends Component> type)
type -
public boolean isActive()
public boolean isEnabled()
public Component getComponent(ComponentType type)
type - in order to retrieve the component fast you must provide a
ComponentType instance for the expected component.
public <T extends Component> T getComponent(java.lang.Class<T> type)
T - the expected return component type.type - the expected return component type.
public Bag<Component> getComponents(Bag<Component> fillBag)
fillBag - the bag to put the components into.
public void addToWorld()
public void changedInWorld()
public void deleteFromWorld()
public void enable()
public void disable()
public java.util.UUID getUuid()
public World getWorld()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||