monrovia.server.platform
Class Creature

java.lang.Object
  |
  +--monrovia.server.platform.GameObject
        |
        +--monrovia.server.platform.Creature
Direct Known Subclasses:
PlayerCreature

public abstract class Creature
extends GameObject

The abstract base class of a living creature in the game.


Constructor Summary
Creature()
           
 
Method Summary
 void addMessage(java.lang.String pMessage)
           
 void addParameters(ParameterMap pParameters)
          This method will be called to initialize the parameters.
 void addStatUpdate(int pIndex, int pValue)
           
 void addStatUpdate(int pIndex, java.lang.String pValue)
           
 void checkParameters(ParameterMap pParameters)
          This method will be called to check the parameters.
 void die()
          This player is dying.
static IntPoint findFreePointNear(IntPoint pStartPoint, java.lang.String pArea)
          Find a free point in an area.
 java.lang.String getCommandMessage()
           
 int getIconID()
           
 java.util.List getMessages()
           
 java.util.List getNeededParameters()
          Returns a list of parameters that are needed.
 java.util.List getOptionalParameters()
          Returns a list of optional parameters.
 java.lang.String getStartArea()
           
 IntPoint getStartPoint()
           
 Stat[] getStatistics()
           
 void initialize()
          Called when this object is really created.
 boolean isAlive()
           
 void setAlive(boolean pAlive)
           
 void setCommandMessage(java.lang.String pCommandMessage)
           
 void update()
           
 
Methods inherited from class monrovia.server.platform.GameObject
addParameter, clearCommandMarks, create, getArea, getCommandMark, getGI, getID, getLocation, getName, getParameter, removeParameter, resetObject, resetParameters, setCommandMark, setParameter, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Creature

public Creature()
Method Detail

addParameters

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

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

getNeededParameters

public java.util.List getNeededParameters()
Description copied from class: GameObject
Returns a list of parameters that are needed. No checking is done based on this list. Checking should be done in the checkParameters() method. This method is used when we need to query the parameters from the user for example when adding a player.
Overrides:
getNeededParameters in class GameObject

getOptionalParameters

public java.util.List getOptionalParameters()
Description copied from class: GameObject
Returns a list of optional parameters. This is used to tell what parameters the user can set for example when adding a player.
Overrides:
getOptionalParameters in class GameObject

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 GameObject
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.

initialize

public void initialize()
Description copied from class: GameObject
Called when this object is really created. The parameters are in the place for the first time in this point. After this the parameters are cloned for possible reset.
Overrides:
initialize in class GameObject

getStartArea

public java.lang.String getStartArea()

getStartPoint

public IntPoint getStartPoint()

getIconID

public int getIconID()

isAlive

public boolean isAlive()

setAlive

public void setAlive(boolean pAlive)

getCommandMessage

public java.lang.String getCommandMessage()

setCommandMessage

public void setCommandMessage(java.lang.String pCommandMessage)

getMessages

public java.util.List getMessages()

addMessage

public void addMessage(java.lang.String pMessage)

getStatistics

public Stat[] getStatistics()

addStatUpdate

public void addStatUpdate(int pIndex,
                          int pValue)

addStatUpdate

public void addStatUpdate(int pIndex,
                          java.lang.String pValue)

update

public void update()

die

public void die()
This player is dying.

findFreePointNear

public static IntPoint findFreePointNear(IntPoint pStartPoint,
                                         java.lang.String pArea)
Find a free point in an area.

Parameters:
pStartPoint - Start finding from this point
pArea - Find the free point from this map area
Returns:
Point that is free in the given area or null