erland.game.tileadventure
Class TileAdventureModel

java.lang.Object
  extended by erland.game.tileadventure.TileAdventureModel
All Implemented Interfaces:
ActionHandlerInterface, GameObjectMapActionInterface

public class TileAdventureModel
extends Object
implements GameObjectMapActionInterface, ActionHandlerInterface

Implementation of the main game model that handles all the logic in the game


Field Summary
protected  IrregularBlockContainerInterface cont
          Block container for the game area
protected  GameEnvironmentInterface environment
          Game environment object
protected  Vector objectList
          Object list
protected  MapObjectContainerInterface roomMap
          Room map
 
Constructor Summary
TileAdventureModel()
           
 
Method Summary
 void endActionOnObject(GameObject obj, Action action)
           
 MapDrawInterface getMap(GameObject player)
           
 void init(GameEnvironmentInterface environment, IrregularBlockContainerInterface cont)
          Initiate the model
 void initPlayers(GameObject[] players)
           
 ActionInterface isActionPossibleOnObject(GameObject obj, Action action)
           
 boolean isFree(GameObject obj, Box3D boundingBox)
           
 boolean isFree(GameObject obj, float x, float y, float z)
           
 boolean isFree(MapObjectContainerInterface map, GameObject obj, float x, float y, float z)
           
 boolean move(GameObject obj, float x, float y, float z)
           
 void register(ActionInterface action)
           
 ActionInterface startActionOnObject(GameObject obj, Action action)
           
 void unregister(ActionInterface action)
           
 void update()
          Update model, this will move all cars, check for collisions and apply frictions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cont

protected IrregularBlockContainerInterface cont
Block container for the game area


environment

protected GameEnvironmentInterface environment
Game environment object


roomMap

protected MapObjectContainerInterface roomMap
Room map


objectList

protected Vector objectList
Object list

Constructor Detail

TileAdventureModel

public TileAdventureModel()
Method Detail

init

public void init(GameEnvironmentInterface environment,
                 IrregularBlockContainerInterface cont)
Initiate the model

Parameters:
environment - Game environment
cont - Block container for the track

initPlayers

public void initPlayers(GameObject[] players)

update

public void update()
Update model, this will move all cars, check for collisions and apply frictions


getMap

public MapDrawInterface getMap(GameObject player)

isFree

public boolean isFree(MapObjectContainerInterface map,
                      GameObject obj,
                      float x,
                      float y,
                      float z)

isFree

public boolean isFree(GameObject obj,
                      float x,
                      float y,
                      float z)

isFree

public boolean isFree(GameObject obj,
                      Box3D boundingBox)

move

public boolean move(GameObject obj,
                    float x,
                    float y,
                    float z)
Specified by:
move in interface GameObjectMapActionInterface

isActionPossibleOnObject

public ActionInterface isActionPossibleOnObject(GameObject obj,
                                                Action action)

startActionOnObject

public ActionInterface startActionOnObject(GameObject obj,
                                           Action action)

endActionOnObject

public void endActionOnObject(GameObject obj,
                              Action action)

register

public void register(ActionInterface action)
Specified by:
register in interface ActionHandlerInterface

unregister

public void unregister(ActionInterface action)
Specified by:
unregister in interface ActionHandlerInterface


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