public abstract class ObjectGame extends 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.
|
Animation |
getDataAnimation(String name)
Get an animation data from its name.
|
boolean |
getDataBoolean(String attribute,
String... path)
Get a boolean in the xml tree.
|
CollisionData |
getDataCollision(String name)
Get a collision data from its name.
|
double |
getDataDouble(String attribute,
String... path)
Get a double in the xml tree.
|
int |
getDataInteger(String attribute,
String... path)
Get an integer in the xml tree.
|
XmlNode |
getDataRoot()
Get the data root container for raw access.
|
String |
getDataString(String attribute,
String... path)
Get a string in the xml tree.
|
Integer |
getId()
Get the entity id (unique).
|
boolean |
isDestroyed()
Check if entity is going to be removed.
|
void |
loadData(Media media)
Load data from configuration media.
|
public ObjectGame(SetupGame setup)
setup
- The setup reference.public final Integer getId()
public void destroy()
public boolean isDestroyed()
true
if going to be removed, false
else.public void loadData(Media media)
Configurable
loadData
in interface Configurable
media
- The xml media.public XmlNode getDataRoot()
Configurable
getDataRoot
in interface Configurable
public String getDataString(String attribute, String... path)
Configurable
getDataString
in interface Configurable
attribute
- The attribute to get as string.path
- The node path (child list)public int getDataInteger(String attribute, String... path)
Configurable
getDataInteger
in interface Configurable
attribute
- The attribute to get as integer.path
- The node path (child list)public boolean getDataBoolean(String attribute, String... path)
Configurable
getDataBoolean
in interface Configurable
attribute
- The attribute to get as boolean.path
- The node path (child list)public double getDataDouble(String attribute, String... path)
Configurable
getDataDouble
in interface Configurable
attribute
- The attribute to get as double.path
- The node path (child list)public Animation getDataAnimation(String name)
Configurable
getDataAnimation
in interface Configurable
name
- The animation name.public CollisionData getDataCollision(String name)
Configurable
getDataCollision
in interface Configurable
name
- The collision name.Copyright © 2014 Byron 3D Games Studio. All rights reserved.