simogl.gameobjects
Class AbstractGameObject

java.lang.Object
  extended by simogl.gameobjects.AbstractGameObject
Direct Known Subclasses:
AbstractBuilding, AbstractCharacter

public abstract class AbstractGameObject
extends java.lang.Object

This class is the basic model of any other game object

Author:
Frank Bruns

Constructor Summary
AbstractGameObject(float x, float y, float z)
          Creates a new game object
 
Method Summary
 AbstractMD2Model getModel()
          Returns the md2 model of the character
 java.lang.String getName()
          Returns the name of the game object
 Point3D getPosition()
          Returns the position of the gane object as a Point3D object
 float getX()
          Returns the x-position of the game object
 float getY()
          Returns the y-position of the game object
 float getZ()
          Returns the z-position of the game object
 void setPosition(float x, float y, float z)
          Sets the position of the game object to the specified parameters
 void setPosition(Point3D position)
          Sets the position of the game object
 void setX(float x)
          Sets the x-coordinate of the game object
 void setY(float y)
          Sets the y-coordinate of the game object
 void setZ(float z)
          Sets the z-coordinate of the game object
abstract  void update(long elapsedTime)
          Updates a game object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractGameObject

public AbstractGameObject(float x,
                          float y,
                          float z)
Creates a new game object

Parameters:
x - x-coordinate
y - y-coordinate
z - z-coordinate
Method Detail

getModel

public AbstractMD2Model getModel()
Returns the md2 model of the character

Returns:
md2 model of the character

getPosition

public Point3D getPosition()
Returns the position of the gane object as a Point3D object

Returns:
position of the game object

setPosition

public void setPosition(Point3D position)
Sets the position of the game object

Parameters:
position - position to set the game object to

setPosition

public void setPosition(float x,
                        float y,
                        float z)
Sets the position of the game object to the specified parameters

Parameters:
x - x-coordinate
y - y-coordinate
z - z-coordinate

setX

public void setX(float x)
Sets the x-coordinate of the game object

Parameters:
x - x-coordinate

setY

public void setY(float y)
Sets the y-coordinate of the game object

Parameters:
y - y-coordinate

setZ

public void setZ(float z)
Sets the z-coordinate of the game object

Parameters:
z - z-coordinate

getX

public float getX()
Returns the x-position of the game object

Returns:
x-coordinate of the game object

getY

public float getY()
Returns the y-position of the game object

Returns:
y-coordinate of the game object

getZ

public float getZ()
Returns the z-position of the game object

Returns:
z-coordinate of the game object

getName

public java.lang.String getName()
Returns the name of the game object

Returns:
name of the game object

update

public abstract void update(long elapsedTime)
Updates a game object

Parameters:
elapsedTime - time between two frames