Mallet Engine
2
Entity-Component based game engine, written in Java.
|
Public Member Functions | |
Entity () | |
Entity (final String _name) | |
Entity (final String _name, final String _family) | |
void | setName (final String _name) |
String | getName () |
final void | setPosition (final float _x, final float _y, final float _z) |
final void | addToPosition (final float _x, final float _y, final float _z) |
final boolean | isName (final String _name) |
final boolean | isFamily (final String _family) |
final void | addComponent (final Component _component) |
final void | removeComponent (final Component _component) |
final void | removeComponents (final ArrayList< Component > _components) |
final void | update (final float _dt) |
final Component | getComponentByName (final String _name) |
final ArrayList< Component > | getComponentsByName (final String _name) |
final ArrayList< Component > | getComponentByGroup (final String _group) |
final ArrayList< Component > | getAllComponents () |
final Vector3 | getPosition () |
final void | destroy () |
boolean | writeObject (final SerialiseOutput _output) |
boolean | readObject (final SerialiseInput _input) |
void | clear () |
Public Attributes | |
String | name = null |
String | family = null |
Vector3 | position = new Vector3( 0.0f, 0.0f, 0.0f ) |
boolean | destroy = false |
Entity is a container class for Componets. By default an Entity should have a unique name, and a global family name. For example an Entity could be named HENCHMAN3, and be in the ENEMY family.
Entity also allows an internal component to send messages to other components, it operates in a similar basis to the EventSystem.
Entity does not have the capabilities to recieve Events from a Game State, this should be done through a component like EventComponent that can then route it through the Component Event System.
com.linxonline.mallet.entity.Entity.Entity | ( | final String | _name | ) |
com.linxonline.mallet.entity.Entity.Entity | ( | final String | _name, |
final String | _family | ||
) |
final void com.linxonline.mallet.entity.Entity.addComponent | ( | final Component | _component | ) |
final void com.linxonline.mallet.entity.Entity.addToPosition | ( | final float | _x, |
final float | _y, | ||
final float | _z | ||
) |
final void com.linxonline.mallet.entity.Entity.destroy | ( | ) |
final ArrayList<Component> com.linxonline.mallet.entity.Entity.getAllComponents | ( | ) |
Returns the ArrayList that contains all the Entity's Components. NOTE: the ArrayList is NOT a copy.
final ArrayList<Component> com.linxonline.mallet.entity.Entity.getComponentByGroup | ( | final String | _group | ) |
Get the Components that have the same Group name and return them in an ArrayList. NOTE: A new ArrayList is created each time this function is called.
final Component com.linxonline.mallet.entity.Entity.getComponentByName | ( | final String | _name | ) |
Get a Component with the designated name. If there is more than one component with that name, then it will return the first one it finds.
final ArrayList<Component> com.linxonline.mallet.entity.Entity.getComponentsByName | ( | final String | _name | ) |
Return all the components with the designated name
String com.linxonline.mallet.entity.Entity.getName | ( | ) |
final Vector3 com.linxonline.mallet.entity.Entity.getPosition | ( | ) |
Returns the Entiy's current position
final boolean com.linxonline.mallet.entity.Entity.isFamily | ( | final String | _family | ) |
returns true if _family equals Entity family false if not
final boolean com.linxonline.mallet.entity.Entity.isName | ( | final String | _name | ) |
returns true if _name equals Entity name false if not
boolean com.linxonline.mallet.entity.Entity.readObject | ( | final SerialiseInput | _input | ) |
final void com.linxonline.mallet.entity.Entity.removeComponent | ( | final Component | _component | ) |
final void com.linxonline.mallet.entity.Entity.removeComponents | ( | final ArrayList< Component > | _components | ) |
void com.linxonline.mallet.entity.Entity.setName | ( | final String | _name | ) |
Once a name has been set it should not be changed. The Entity System may change an Entitys name to ensure it is unique.
final void com.linxonline.mallet.entity.Entity.setPosition | ( | final float | _x, |
final float | _y, | ||
final float | _z | ||
) |
final void com.linxonline.mallet.entity.Entity.update | ( | final float | _dt | ) |
Update the message system of the Entity and update the Components
boolean com.linxonline.mallet.entity.Entity.writeObject | ( | final SerialiseOutput | _output | ) |
Used to write out the byte stream of the Entity object
boolean com.linxonline.mallet.entity.Entity.destroy = false |
String com.linxonline.mallet.entity.Entity.family = null |
String com.linxonline.mallet.entity.Entity.name = null |
Vector3 com.linxonline.mallet.entity.Entity.position = new Vector3( 0.0f, 0.0f, 0.0f ) |