monrovia.game.creatures
Class ComputerGameCreature

java.lang.Object
  |
  +--monrovia.server.platform.GameObject
        |
        +--monrovia.server.platform.Creature
              |
              +--monrovia.server.platform.map.PlayerCreature
                    |
                    +--monrovia.game.creatures.GameCreature
                          |
                          +--monrovia.game.creatures.ComputerGameCreature
All Implemented Interfaces:
ComputerCreature
Direct Known Subclasses:
AggressiveCreature, NeutralCreature, ScaredCreature

public abstract class ComputerGameCreature
extends GameCreature
implements ComputerCreature

ComputerGameCreature implements the ComputerCreature interface for computer controlled players


Fields inherited from class monrovia.game.creatures.GameCreature
mAttackTarget, mMsgCrit, mMsgFleeFalse, mMsgFleeTrue, mMsgHit, mMsgMiss, mMsgYouCrit, mMsgYouFleeFalse, mMsgYouFleeTrue, mMsgYouHit, mMsgYouMiss
 
Constructor Summary
ComputerGameCreature()
           
 
Method Summary
 void addParameters(ParameterMap pParameters)
          This method will be called to initialize the parameters.
 void checkParameters(ParameterMap pParameters)
          This method will be called to check the parameters.
 Command getCommand()
          Return command for next turn.
 boolean isComputer()
          Returns whether this creature is a computer creature.
abstract  boolean isScared()
          Are we scared
abstract  boolean isVisibleEnemy(GameCreature pVisible)
          Is the creature in sight our enemy
 void setComputer(boolean pComputer)
          Set whether this is a computer controlled creature.
 
Methods inherited from class monrovia.game.creatures.GameCreature
addEnemy, canMove, d, doDamage, escaped, getOptionalParameters, getParam, getStatistics, isMoving, removeEnemy, resetObject, setMoving, setParam, setTarget, tryFlee, update
 
Methods inherited from class monrovia.server.platform.map.PlayerCreature
addMessage, addStatUpdate, addStatUpdate, die, exit, getMessages, initialize, isPlayer, isSavePoint, reconnect, sendUpdate, setPlayer, setSavePoint, setSenders
 
Methods inherited from class monrovia.server.platform.Creature
findFreePointNear, getCommandMessage, getIconID, getNeededParameters, getStartArea, getStartPoint, isAlive, setAlive, setCommandMessage
 
Methods inherited from class monrovia.server.platform.GameObject
addParameter, clearCommandMarks, create, getArea, getCommandMark, getGI, getID, getLocation, getName, getParameter, removeParameter, resetParameters, setCommandMark, setParameter, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComputerGameCreature

public ComputerGameCreature()
Method Detail

isVisibleEnemy

public abstract boolean isVisibleEnemy(GameCreature pVisible)
Is the creature in sight our enemy

isScared

public abstract boolean isScared()
Are we scared

isComputer

public boolean isComputer()
Returns whether this creature is a computer creature. Note that creature implementation can be a computer creature or a computer creature.

Specified by:
isComputer in interface ComputerCreature
Returns:
True if this creature is controlled by a computer

setComputer

public void setComputer(boolean pComputer)
Set whether this is a computer controlled creature. The platform will call this with the parameter true for the creatures loaded from the game data.

Specified by:
setComputer in interface ComputerCreature
Parameters:
pComputer - True if this creature is controlled by a computer

addParameters

public void addParameters(ParameterMap pParameters)
Description copied from class: GameObject
This method will be called to initialize the parameters.

Overrides:
addParameters in class GameCreature
Following copied from class: monrovia.server.platform.GameObject
Parameters:
pParameters - Add the parameters here

checkParameters

public void checkParameters(ParameterMap pParameters)
                     throws StorageException
Description copied from class: GameObject
This method will be called to check the parameters.

Overrides:
checkParameters in class GameCreature
Following copied from class: monrovia.server.platform.GameObject
Parameters:
pParameters - Check that the parameters are OK
Throws:
StorageException - Throw this if you find an error.

getCommand

public Command getCommand()
Return command for next turn.

Use getGI().getCommand("command name") to get the command. If you want arguments for that command, you should set those before returning.

Specified by:
getCommand in interface ComputerCreature
Returns:
Name of a command or null to do nothing