erland.game.tileadventure
Class GameObject

java.lang.Object
  extended by erland.game.tileadventure.GameObject
All Implemented Interfaces:
MapObjectInterface, Cloneable
Direct Known Subclasses:
AnimatedObject, BitmapObject

public abstract class GameObject
extends Object
implements Cloneable, MapObjectInterface


Constructor Summary
GameObject()
           
 
Method Summary
 boolean action(Action action)
           
protected  boolean actionChild(Action action)
           
 Object clone()
          Clone the block
 void fillBoundingBox(float x, float y, float z, Box3D boundingBox)
           
 GameObjectMapActionInterface getActionMap()
           
 Box3D getBoundingBox()
           
 GameObject[] getChilds()
           
 IrregularBlockContainerInterface getContainer()
          Get the container which the block exists in
 int getDrawingPosX(float dx, float dy, float dz)
           
 int getDrawingPosY(float dx, float dy, float dz)
           
protected  GameEnvironmentInterface getEnvironment()
          Get the game environment which the block exists in
 Vector3D getMoveVector()
           
 float getMovingPosX()
           
 float getMovingPosY()
           
 float getMovingPosZ()
           
 MapObjectContainerInterface getObjectMap()
           
 GameObject getParent()
           
 int getPixelPosX()
           
 int getPixelPosY()
           
 float getPosX()
           
 float getPosY()
           
 float getPosZ()
           
 boolean getRedraw()
          Check if the block needs to be redrawn
 void init(GameEnvironmentInterface environment)
           
protected  Action isActionPossible(Action action)
           
 boolean isMovable(Direction direction)
           
protected  boolean isMovableChild(Direction direction)
           
 boolean isPushable(Direction direction)
           
protected  boolean isPushableChild(Direction direction)
           
 void read(ParameterValueStorageExInterface in)
           
 void setActionMap(GameObjectMapActionInterface actionMap)
           
 void setChilds(GameObject[] childs)
           
 void setContainer(IrregularBlockContainerInterface cont)
           
 void setMoveVector(Vector3D vector)
           
 void setObjectMap(MapObjectContainerInterface objectMap)
           
 void setParent(GameObject parent)
           
 void setPos(float x, float y, float z)
           
 boolean update()
           
 void write(ParameterValueStorageExInterface out)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface erland.game.tileadventure.MapObjectInterface
draw
 

Constructor Detail

GameObject

public GameObject()
Method Detail

init

public void init(GameEnvironmentInterface environment)
Specified by:
init in interface MapObjectInterface

getEnvironment

protected GameEnvironmentInterface getEnvironment()
Get the game environment which the block exists in

Returns:
The game environment the block exists in

getContainer

public IrregularBlockContainerInterface getContainer()
Get the container which the block exists in

Specified by:
getContainer in interface MapObjectInterface
Returns:
The block container

setContainer

public void setContainer(IrregularBlockContainerInterface cont)
Specified by:
setContainer in interface MapObjectInterface

setObjectMap

public void setObjectMap(MapObjectContainerInterface objectMap)

getObjectMap

public MapObjectContainerInterface getObjectMap()

setActionMap

public void setActionMap(GameObjectMapActionInterface actionMap)

getActionMap

public GameObjectMapActionInterface getActionMap()

getPosX

public float getPosX()
Specified by:
getPosX in interface MapObjectInterface

getPosY

public float getPosY()
Specified by:
getPosY in interface MapObjectInterface

getPosZ

public float getPosZ()
Specified by:
getPosZ in interface MapObjectInterface

getMovingPosX

public float getMovingPosX()

getMovingPosY

public float getMovingPosY()

getMovingPosZ

public float getMovingPosZ()

getPixelPosX

public int getPixelPosX()

getPixelPosY

public int getPixelPosY()

getDrawingPosX

public int getDrawingPosX(float dx,
                          float dy,
                          float dz)

getDrawingPosY

public int getDrawingPosY(float dx,
                          float dy,
                          float dz)

setPos

public void setPos(float x,
                   float y,
                   float z)
Specified by:
setPos in interface MapObjectInterface

getRedraw

public boolean getRedraw()
Check if the block needs to be redrawn

Returns:
true/false (Needs redraw/Does not need redraw)

clone

public Object clone()
Clone the block

Specified by:
clone in interface MapObjectInterface
Overrides:
clone in class Object
Returns:
A clone of the block

write

public void write(ParameterValueStorageExInterface out)

read

public void read(ParameterValueStorageExInterface in)

actionChild

protected boolean actionChild(Action action)

action

public boolean action(Action action)

isActionPossible

protected Action isActionPossible(Action action)

isMovableChild

protected boolean isMovableChild(Direction direction)

isMovable

public boolean isMovable(Direction direction)

isPushableChild

protected boolean isPushableChild(Direction direction)

isPushable

public boolean isPushable(Direction direction)

setParent

public void setParent(GameObject parent)

setChilds

public void setChilds(GameObject[] childs)

getChilds

public GameObject[] getChilds()

getParent

public GameObject getParent()

setMoveVector

public void setMoveVector(Vector3D vector)

getMoveVector

public Vector3D getMoveVector()

update

public boolean update()

getBoundingBox

public Box3D getBoundingBox()
Specified by:
getBoundingBox in interface MapObjectInterface

fillBoundingBox

public void fillBoundingBox(float x,
                            float y,
                            float z,
                            Box3D boundingBox)


Copyright © 2003-2006 Erland Isaksson. All Rights Reserved.