com.jme.entity
Class Entity

java.lang.Object
  extended by com.jme.entity.Entity

public class Entity
extends java.lang.Object

Entity defines a core game element. An entity defines any object within the game world. The Entity will contain all relevant game information allowing for easy data reference and control.

Version:
$Id: Entity.java 4131 2009-03-19 20:15:28Z blaine.dev $
Author:
Mark Powell

Constructor Summary
Entity(java.lang.String id)
          Constructor creates a new Entity object.
Entity(java.lang.String id, java.util.Properties props)
          Constructor creates a new Entity object.
 
Method Summary
 java.lang.String getId()
          getId returns this entity's id.
 java.lang.Object getProperty(java.lang.String propertyName)
          Get a property of this entity.
 Spatial getSpatial()
          getSpatial retrieves the spatial object of the entity.
 void setProperty(java.lang.String propertyName, java.lang.Object property)
          Binds a property name of the entity with it's property object.
 void setSpatial(Spatial spatial)
          setSpatial sets the spatial object used to define the entitie's graphical representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Entity

public Entity(java.lang.String id)
Constructor creates a new Entity object. During creation a string id is used to denote a unique entity.

Parameters:
id - the entity id.

Entity

public Entity(java.lang.String id,
              java.util.Properties props)
Constructor creates a new Entity object. During creation a string id is used to denote a unique entity, with predefined properties.

Parameters:
id - the entity id.
props - the entity properties.
Method Detail

setSpatial

public void setSpatial(Spatial spatial)
setSpatial sets the spatial object used to define the entitie's graphical representation.

Parameters:
spatial - the spatial object used to describe the geometry of the entity.

getSpatial

public Spatial getSpatial()
getSpatial retrieves the spatial object of the entity.

Returns:
the spatial object of the entity.

getId

public java.lang.String getId()
getId returns this entity's id.

Returns:
the id of the entity.

getProperty

public java.lang.Object getProperty(java.lang.String propertyName)
Get a property of this entity.

Parameters:
propertyName - the property name to retrieve.
Returns:
The entity's property linked to propertyName.

setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.Object property)
Binds a property name of the entity with it's property object.

Parameters:
propertyName - the property name.
property - the propery to bind with the name.