public class DefaultWatchedEntity extends java.lang.Object implements WatchedEntity
Constructor and Description |
---|
DefaultWatchedEntity(EntityData ed,
EntityId id,
java.lang.Class<EntityComponent>[] types) |
DefaultWatchedEntity(EntityData ed,
EntityId id,
EntityComponent[] data,
java.lang.Class<EntityComponent>[] types) |
Modifier and Type | Method and Description |
---|---|
protected void |
addChange(EntityChange change) |
protected boolean |
applyChange(EntityChange change) |
boolean |
applyChanges()
Applies any accumulated changes to this entity since
the last time applyChanges() was called and returns true
if changes were applied.
|
boolean |
applyChanges(java.util.Set<EntityChange> updates)
Applies any accumulated changes to this entity since
the last time applyChanges() was called and returns true
if changes were applied.
|
<T extends EntityComponent> |
get(java.lang.Class<T> type) |
EntityComponent[] |
getComponents() |
EntityId |
getId() |
protected EntityComponentListener |
getListener() |
boolean |
hasChanges()
Returns true if this entity has changes
ready to be applied.
|
boolean |
isComplete() |
protected boolean |
isReleased() |
protected void |
load() |
void |
release()
Releases this entity from processing further entity
updates.
|
void |
set(EntityComponent c) |
java.lang.String |
toString() |
public DefaultWatchedEntity(EntityData ed, EntityId id, java.lang.Class<EntityComponent>[] types)
public DefaultWatchedEntity(EntityData ed, EntityId id, EntityComponent[] data, java.lang.Class<EntityComponent>[] types)
protected final void load()
protected EntityComponentListener getListener()
public <T extends EntityComponent> T get(java.lang.Class<T> type)
public void set(EntityComponent c)
public boolean isComplete()
isComplete
in interface Entity
public EntityComponent[] getComponents()
getComponents
in interface Entity
public boolean hasChanges()
WatchedEntity
hasChanges
in interface WatchedEntity
public boolean applyChanges()
WatchedEntity
applyChanges
in interface WatchedEntity
public boolean applyChanges(java.util.Set<EntityChange> updates)
WatchedEntity
applyChanges
in interface WatchedEntity
protected boolean applyChange(EntityChange change)
public void release()
WatchedEntity
release
in interface WatchedEntity
protected boolean isReleased()
protected void addChange(EntityChange change)
public java.lang.String toString()
toString
in class java.lang.Object