shoddybattle
Class ModData

java.lang.Object
  extended by shoddybattle.ModData

public class ModData
extends java.lang.Object

This class encapsulates a complete set of "moddata". Mod data does not just include a patch against the pokemon data. In fact, a ModData object contains all of the following:


Field Summary
static java.io.File MOD_DATA_FILE
          The mod data file name on the server.
 
Constructor Summary
ModData(java.io.File f)
          Construct a new ModData object via a file.
 
Method Summary
static void addServer(java.lang.String uuid, java.lang.String name)
          Add a server to the map of uuid -> server name.
 void applyPatch(java.io.InputStream stream)
           
 void applyPatch(java.io.InputStream stream, int category)
          Apply a mod data patch to this ModData object.
static ModData getDefaultData()
          Get the default ModData.
 HoldItemData getHoldItemData()
          Get the hold item data.
static ModData getModData(java.lang.String name)
          Return the ModData object corresponding to the given name, attempting to load from disc if required.
 long getModDataLength()
          Get the length of the mod data file.
 MoveList getMoveData()
          Get the move data.
 MoveSetData getMoveSetData()
          Get the move set data.
 java.lang.String getName()
          Get the name of the ModData.
static java.lang.String getServerName(java.lang.String uuid)
          Find a server name given its uuid.
 PokemonSpeciesData getSpeciesData()
          Get the species data.
static java.lang.String getStorageLocation()
          Get the location where mod data is stored on the hard disc.
 void loadModData(java.io.File f)
          Load mod data (@see saveModData) from a file.
 void saveModData(java.io.OutputStream output)
          Save mod data (species, abilities, move sets, and items) to a file which can be opened by a client to allow for creating items that will play on this mod server.
 void setModDataLength(long length)
          Set the length of the mod data file.
static void setStorageLocation(java.lang.String value)
          Set the location where mod data is stored on the hard disc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MOD_DATA_FILE

public static final java.io.File MOD_DATA_FILE
The mod data file name on the server.

Constructor Detail

ModData

public ModData(java.io.File f)
Construct a new ModData object via a file.

Method Detail

getName

public java.lang.String getName()
Get the name of the ModData.


getModData

public static ModData getModData(java.lang.String name)
Return the ModData object corresponding to the given name, attempting to load from disc if required.


getDefaultData

public static ModData getDefaultData()
Get the default ModData.


getSpeciesData

public PokemonSpeciesData getSpeciesData()
Get the species data.


getMoveSetData

public MoveSetData getMoveSetData()
Get the move set data.


getHoldItemData

public HoldItemData getHoldItemData()
Get the hold item data.


getMoveData

public MoveList getMoveData()
Get the move data.


saveModData

public void saveModData(java.io.OutputStream output)
Save mod data (species, abilities, move sets, and items) to a file which can be opened by a client to allow for creating items that will play on this mod server.


setModDataLength

public void setModDataLength(long length)
Set the length of the mod data file.


getModDataLength

public long getModDataLength()
Get the length of the mod data file.


loadModData

public void loadModData(java.io.File f)
Load mod data (@see saveModData) from a file.


applyPatch

public void applyPatch(java.io.InputStream stream)
                throws java.io.IOException
Throws:
java.io.IOException

applyPatch

public void applyPatch(java.io.InputStream stream,
                       int category)
                throws java.io.IOException
Apply a mod data patch to this ModData object.

Throws:
java.io.IOException

getStorageLocation

public static java.lang.String getStorageLocation()
Get the location where mod data is stored on the hard disc.


setStorageLocation

public static void setStorageLocation(java.lang.String value)
Set the location where mod data is stored on the hard disc.


addServer

public static void addServer(java.lang.String uuid,
                             java.lang.String name)
Add a server to the map of uuid -> server name.


getServerName

public static java.lang.String getServerName(java.lang.String uuid)
Find a server name given its uuid.