public abstract class ObjectGame extends java.lang.Object implements Configurable
HandlerObjectGame
. To remove it from the handler, a simple call to destroy()
is needed. An object
can also be externally configured by using a Configurable
, filled by an XML file.Configurable
,
HandlerObjectGame
Constructor and Description |
---|
ObjectGame(SetupGame setup)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Remove object from handler, and free memory.
|
com.b3dgs.lionengine.anim.Animation |
getDataAnimation(java.lang.String name)
Get an animation data from its name.
|
boolean |
getDataBoolean(java.lang.String attribute,
java.lang.String... path)
Get a boolean in the xml tree.
|
CollisionData |
getDataCollision(java.lang.String name)
Get a collision data from its name.
|
double |
getDataDouble(java.lang.String attribute,
java.lang.String... path)
Get a double in the xml tree.
|
int |
getDataInteger(java.lang.String attribute,
java.lang.String... path)
Get an integer in the xml tree.
|
com.b3dgs.lionengine.file.XmlNode |
getDataRoot()
Get the data root container for raw access.
|
java.lang.String |
getDataString(java.lang.String attribute,
java.lang.String... path)
Get a string in the xml tree.
|
java.lang.Integer |
getId()
Get the entity id (unique).
|
boolean |
isDestroyed()
Check if entity is going to be removed.
|
void |
loadData(com.b3dgs.lionengine.core.Media media)
Load data from configuration media.
|
public ObjectGame(SetupGame setup)
setup
- The setup reference.public final java.lang.Integer getId()
public void destroy()
public boolean isDestroyed()
true
if going to be removed, false
else.public void loadData(com.b3dgs.lionengine.core.Media media)
Configurable
loadData
in interface Configurable
media
- The xml media.public com.b3dgs.lionengine.file.XmlNode getDataRoot()
Configurable
getDataRoot
in interface Configurable
public java.lang.String getDataString(java.lang.String attribute, java.lang.String... path)
Configurable
getDataString
in interface Configurable
attribute
- The attribute to get as string.path
- The node path (child list)public int getDataInteger(java.lang.String attribute, java.lang.String... path)
Configurable
getDataInteger
in interface Configurable
attribute
- The attribute to get as integer.path
- The node path (child list)public boolean getDataBoolean(java.lang.String attribute, java.lang.String... path)
Configurable
getDataBoolean
in interface Configurable
attribute
- The attribute to get as boolean.path
- The node path (child list)public double getDataDouble(java.lang.String attribute, java.lang.String... path)
Configurable
getDataDouble
in interface Configurable
attribute
- The attribute to get as double.path
- The node path (child list)public com.b3dgs.lionengine.anim.Animation getDataAnimation(java.lang.String name)
Configurable
getDataAnimation
in interface Configurable
name
- The animation name.public CollisionData getDataCollision(java.lang.String name)
Configurable
getDataCollision
in interface Configurable
name
- The collision name.