monrovia.server.core
Class GameDataImpl

java.lang.Object
  |
  +--monrovia.server.core.GameDataImpl
All Implemented Interfaces:
GameDataStorage.GameData

public class GameDataImpl
extends java.lang.Object
implements GameDataStorage.GameData

Loading implementation for the platform end.


Inner Class Summary
 class GameDataImpl.MapDataImpl
           
 class GameDataImpl.ObjectDataImpl
           
 
Field Summary
static java.lang.String DEFAULT_PLAYER_CREATURE
           
static java.lang.String DEFAULT_WALK
           
static short[] EMPTY_ICON
           
static int EMPTY_ICON_ID
           
static short[] PLAYER_ICON
           
static int PLAYER_ICON_ID
           
 
Constructor Summary
GameDataImpl()
          Constructor.
 
Method Summary
 GameDataStorage.ObjectData addAzoic(java.lang.String pName, java.lang.String pImplementation, byte[] pIcon)
          Add a new static map object aka an azoic.
 GameDataStorage.ObjectData addCommand(java.lang.String pName, java.lang.String pImplementation)
          Add a new command type.
 GameDataStorage.ObjectData addCreature(java.lang.String pName, java.lang.String pImplementation, byte[] pIcon)
          Add a new creature.
 void addEmbryo(java.lang.String pArea, Creature pCreature)
           
 GameDataStorage.ObjectData addGround(java.lang.String pName, java.lang.String pImplementation)
          Add a new ground object.
 GameDataStorage.MapData addMapArea(java.lang.String pName, int pWidth, int pHeight, int pDefaultGroundID)
          Add a new map area.
 void check()
           
 void command(int pID, Creature pCreature)
           
 void command(int pID, Creature pCreature, int pArg)
           
 void command(int pID, Creature pCreature, int pArg1, int pArg2)
           
 void command(int pID, Creature pCreature, java.lang.String pArg)
           
 Command getCommand(java.lang.String pName)
           
 java.lang.String getPlayerCreatureImpl()
           
 java.lang.String getWalkImplementation()
           
static byte[] iconToByteArray(short[] pIcon)
           
 boolean isMapArea(java.lang.String pArea)
           
 void setPlayerCreatureImpl(java.lang.String pPlayerCreatureImpl)
          Set the class that implements player creature.
 void setWalkImplementation(java.lang.String pWalkImplementation)
          Set the class that implements walking.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_WALK

public static final java.lang.String DEFAULT_WALK

DEFAULT_PLAYER_CREATURE

public static final java.lang.String DEFAULT_PLAYER_CREATURE

EMPTY_ICON_ID

public static final int EMPTY_ICON_ID

EMPTY_ICON

public static final short[] EMPTY_ICON

PLAYER_ICON_ID

public static final int PLAYER_ICON_ID

PLAYER_ICON

public static final short[] PLAYER_ICON
Constructor Detail

GameDataImpl

public GameDataImpl()
Constructor.
Method Detail

getWalkImplementation

public java.lang.String getWalkImplementation()

setWalkImplementation

public void setWalkImplementation(java.lang.String pWalkImplementation)
Description copied from interface: GameDataStorage.GameData
Set the class that implements walking.

Note: This has no effect, if this is used after first command is added.

Specified by:
setWalkImplementation in interface GameDataStorage.GameData
Following copied from interface: monrovia.server.core.GameDataStorage.GameData
Parameters:
pImplementation - The name of the walk implementation

getPlayerCreatureImpl

public java.lang.String getPlayerCreatureImpl()

setPlayerCreatureImpl

public void setPlayerCreatureImpl(java.lang.String pPlayerCreatureImpl)
Description copied from interface: GameDataStorage.GameData
Set the class that implements player creature.

Specified by:
setPlayerCreatureImpl in interface GameDataStorage.GameData
Following copied from interface: monrovia.server.core.GameDataStorage.GameData
Parameters:
pImplementation - The name of the player creature implementation

addGround

public GameDataStorage.ObjectData addGround(java.lang.String pName,
                                            java.lang.String pImplementation)
                                     throws StorageException
Description copied from interface: GameDataStorage.GameData
Add a new ground object.

Specified by:
addGround in interface GameDataStorage.GameData
Following copied from interface: monrovia.server.core.GameDataStorage.GameData
Parameters:
pName - Name of the object
pImplementation - Name of the implementing class
Returns:
Pass the loaded object data for this object

addMapArea

public GameDataStorage.MapData addMapArea(java.lang.String pName,
                                          int pWidth,
                                          int pHeight,
                                          int pDefaultGroundID)
Description copied from interface: GameDataStorage.GameData
Add a new map area.

Specified by:
addMapArea in interface GameDataStorage.GameData
Following copied from interface: monrovia.server.core.GameDataStorage.GameData
Parameters:
pName - Name of the map area
pWidth - Width of the area
pHeight - Height of the area
pDefaultGroundID - Default ground
Returns:
Pass the loaded map data for this object.

addCommand

public GameDataStorage.ObjectData addCommand(java.lang.String pName,
                                             java.lang.String pImplementation)
                                      throws StorageException
Description copied from interface: GameDataStorage.GameData
Add a new command type.

Specified by:
addCommand in interface GameDataStorage.GameData
Following copied from interface: monrovia.server.core.GameDataStorage.GameData
Parameters:
pName - Name of the command. This will appear to the Palm
pImplementation - Name of the implementing class
Returns:
Pass the loaded command data for this object.
Throws:
java.lang.ClassNotFoundException - If the implementation class is not found.

addAzoic

public GameDataStorage.ObjectData addAzoic(java.lang.String pName,
                                           java.lang.String pImplementation,
                                           byte[] pIcon)
                                    throws StorageException
Description copied from interface: GameDataStorage.GameData
Add a new static map object aka an azoic.

Specified by:
addAzoic in interface GameDataStorage.GameData
Following copied from interface: monrovia.server.core.GameDataStorage.GameData
Parameters:
pName - Name of the object
pImplementation - Name of the implementing class
pIcon - The icon to show in the Palm map
Returns:
Pass the loaded object data for this object

addCreature

public GameDataStorage.ObjectData addCreature(java.lang.String pName,
                                              java.lang.String pImplementation,
                                              byte[] pIcon)
                                       throws StorageException
Description copied from interface: GameDataStorage.GameData
Add a new creature.

Specified by:
addCreature in interface GameDataStorage.GameData
Following copied from interface: monrovia.server.core.GameDataStorage.GameData
Parameters:
pName - name of the object
pImplementation - Name of the implementing class
pIcon - The icon to show in the Palm map
Returns:
Pass the loaded object data for this object

check

public void check()
           throws StorageException

isMapArea

public boolean isMapArea(java.lang.String pArea)

addEmbryo

public void addEmbryo(java.lang.String pArea,
                      Creature pCreature)

command

public void command(int pID,
                    Creature pCreature)

command

public void command(int pID,
                    Creature pCreature,
                    int pArg)

command

public void command(int pID,
                    Creature pCreature,
                    int pArg1,
                    int pArg2)

command

public void command(int pID,
                    Creature pCreature,
                    java.lang.String pArg)

getCommand

public Command getCommand(java.lang.String pName)

iconToByteArray

public static byte[] iconToByteArray(short[] pIcon)