|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--monrovia.server.platform.GameObject
Abstract base class for all game objects. This includes at least map objects and commands.
Constructor Summary | |
protected |
GameObject()
Constructor. |
Method Summary | |
void |
addParameter(java.lang.String pKey,
java.lang.Class pType)
Add a parameter. |
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. |
static void |
clearCommandMarks()
This is called after a turn to clear the marks that has been set in that turn. |
static GameObject |
create(GameObjectData pData)
Create new GameObject from given data. |
java.lang.String |
getArea()
Get the area where this object is currently located. |
Command |
getCommandMark(java.lang.String pKey)
Get the command object that has set a mark. |
GameInterface |
getGI()
Shorter method to get the GameInterface instance. |
int |
getID()
Get the GameObject ID. |
IntPoint |
getLocation()
Get the location of this object in the current map area. |
java.lang.String |
getName()
Get the name of this object. |
java.util.List |
getNeededParameters()
Returns a list of parameters that are needed. |
java.util.List |
getOptionalParameters()
Returns a list of optional parameters. |
java.lang.Object |
getParameter(java.lang.String pKey)
Get value for given parameter. |
void |
initialize()
Called when this object is really created. |
java.lang.Object |
removeParameter(java.lang.String pKey)
Remove a parameter. |
void |
resetObject()
Place for the game implementor to reset needed stuff. |
void |
resetParameters()
Reset the parameters to the situation after initialize() . |
void |
setCommandMark(java.lang.String pKey,
Command pCommand)
Commands can set marks with this method to find out conflicts with other commands. |
void |
setParameter(java.lang.String pKey,
java.lang.Object pValue)
Set the value for a parameter. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected GameObject()
GameObjectData.create()
instead.Method Detail |
public GameInterface getGI()
public void addParameters(ParameterMap pParameters)
pParameters
- Add the parameters herepublic java.util.List getNeededParameters()
checkParameters()
method. This method is used when
we need to query the parameters from the user for example when
adding a player.public java.util.List getOptionalParameters()
public void checkParameters(ParameterMap pParameters) throws StorageException
pParameters
- Check that the parameters are OKStorageException
- Throw this if you find an error.public static GameObject create(GameObjectData pData)
pData
- Data object for the new objectpublic void initialize()
public final int getID()
public final java.lang.String getName()
public final java.lang.Object getParameter(java.lang.String pKey)
public final void addParameter(java.lang.String pKey, java.lang.Class pType)
public final void setParameter(java.lang.String pKey, java.lang.Object pValue)
public final java.lang.Object removeParameter(java.lang.String pKey)
public final void resetParameters()
initialize()
.public void resetObject()
public final IntPoint getLocation()
public final java.lang.String getArea()
public void setCommandMark(java.lang.String pKey, Command pCommand)
Command.tryExecution()
.
pKey
- Key for the markpCommand
- Command object that is setting this mark.public Command getCommandMark(java.lang.String pKey)
public static void clearCommandMarks()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |