monrovia.server.platform.map
Class PlayerCreature

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

public class PlayerCreature
extends Creature

Creature for the player.


Constructor Summary
PlayerCreature()
          Constructor.
 
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 die()
          This player is dying.
 void exit()
           
 java.util.List getMessages()
           
 void initialize()
          Called when this object is really created.
 boolean isPlayer()
          Returns whether this creature is a player creature.
 boolean isSavePoint()
          Return whether the current location will be set as the starting point.
 void reconnect(java.lang.String pMessage)
           
 void sendUpdate()
          Send update for the client
 void setPlayer(boolean pPlayer)
          This is used by the platform to mark this creature as player creature.
 void setSavePoint(boolean pSavePoint)
          Set whether the current location will be set as the starting point.
 void setSenders(ServerTcpSender pTcpSender, ServerUdpSender pUdpSender)
          Set the senders that are used to communicate to the client.
 
Methods inherited from class monrovia.server.platform.Creature
checkParameters, findFreePointNear, getCommandMessage, getIconID, getNeededParameters, getOptionalParameters, getStartArea, getStartPoint, getStatistics, isAlive, setAlive, setCommandMessage, 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

PlayerCreature

public PlayerCreature()
Constructor.
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 Creature
Following copied from class: monrovia.server.platform.GameObject
Parameters:
pParameters - Add the parameters here

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 Creature

isPlayer

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

Returns:
True if this creature is controlled by a player

setPlayer

public void setPlayer(boolean pPlayer)
This is used by the platform to mark this creature as player creature. The isPlayer() method should return this value.

Parameters:
pPlayer - True if this creature will be controlled by player.

isSavePoint

public boolean isSavePoint()
Return whether the current location will be set as the starting point.

setSavePoint

public void setSavePoint(boolean pSavePoint)
Set whether the current location will be set as the starting point.

setSenders

public void setSenders(ServerTcpSender pTcpSender,
                       ServerUdpSender pUdpSender)
Set the senders that are used to communicate to the client.

Parameters:
pTcpSender - For sending messages over TCP
pUdpSender - For sending messages over UDP

sendUpdate

public void sendUpdate()
Send update for the client

die

public void die()
Description copied from class: Creature
This player is dying.
Overrides:
die in class Creature

reconnect

public void reconnect(java.lang.String pMessage)

exit

public void exit()

getMessages

public java.util.List getMessages()
Overrides:
getMessages in class Creature

addMessage

public void addMessage(java.lang.String pMessage)
Overrides:
addMessage in class Creature

addStatUpdate

public void addStatUpdate(int pIndex,
                          int pValue)
Overrides:
addStatUpdate in class Creature

addStatUpdate

public void addStatUpdate(int pIndex,
                          java.lang.String pValue)
Overrides:
addStatUpdate in class Creature