Modifier and Type | Class and Description |
---|---|
static class |
TAMEModule.Header
TAME Module Header.
|
Constructor and Description |
---|
TAMEModule()
Creates a new module.
|
Modifier and Type | Method and Description |
---|---|
void |
addAction(TAction a)
Add an action to this world.
|
void |
addContainer(TContainer container)
Adds an container to the module.
|
void |
addObject(TObject object)
Adds an object to the module.
|
void |
addPlayer(TPlayer player)
Adds an player to the module.
|
void |
addRoom(TRoom room)
Adds a room to the module.
|
byte[] |
calculateDigest()
Calculates this module's digest - only necessary if read
from a script but never saved.
|
static TAMEModule |
create(java.io.InputStream in)
Reads a module from binary content.
|
TAction |
getActionByIdentity(java.lang.String identity)
Retrieves an action by its identity.
|
TAction |
getActionByName(java.lang.String name)
Retrieves an action by name, case-insensitively.
|
int |
getActionCount()
Gets how many actions are in this module.
|
java.lang.Iterable<java.util.Map.Entry<java.lang.String,TAction>> |
getActionList() |
TContainer |
getContainerByIdentity(java.lang.String identity)
Retrieves a container by identity.
|
int |
getContainerCount()
Gets how many containers are in this module.
|
java.lang.Iterable<java.util.Map.Entry<java.lang.String,TContainer>> |
getContainerList() |
byte[] |
getDigest()
Gets the module digest.
|
TElement |
getElementByIdentity(java.lang.String identity)
Retrieves an element by identity.
|
TAMEModule.Header |
getHeader()
Returns the module header.
|
TObject |
getObjectByIdentity(java.lang.String identity)
Retrieves an Object by identity.
|
int |
getObjectCount()
Gets how many objects are in this module.
|
java.lang.Iterable<java.util.Map.Entry<java.lang.String,TObject>> |
getObjectList() |
TPlayer |
getPlayerByIdentity(java.lang.String identity)
Retrieves a Player by identity.
|
int |
getPlayerCount()
Gets how many players are in this module.
|
java.lang.Iterable<java.util.Map.Entry<java.lang.String,TPlayer>> |
getPlayerList() |
TRoom |
getRoomByIdentity(java.lang.String identity)
Retrieves a Room by identity.
|
int |
getRoomCount()
Gets how many rooms are in this module.
|
java.lang.Iterable<java.util.Map.Entry<java.lang.String,TRoom>> |
getRoomList() |
TWorld |
getWorld()
Gets the module's world.
|
void |
readBytes(java.io.InputStream in)
Imports this object from bytes.
|
static TAMEModule.Header |
readModuleHeader(java.io.InputStream in)
Reads a module header and only the header from a module stream.
|
void |
setWorld(TWorld world)
Sets the module's world.
|
void |
writeBytes(java.io.OutputStream out)
Exports this object to bytes.
|
public static TAMEModule create(java.io.InputStream in) throws java.io.IOException
in
- the input stream to read from.java.io.IOException
- if the stream can't be read.public static TAMEModule.Header readModuleHeader(java.io.InputStream in) throws java.io.IOException
in
- the input stream to read from.java.io.IOException
- if the stream can't be read.public TAMEModule.Header getHeader()
public byte[] getDigest()
calculateDigest()
public void addAction(TAction a)
a
- the Action to add.public TAction getActionByName(java.lang.String name)
name
- the Action's name.public TAction getActionByIdentity(java.lang.String identity)
identity
- the Action's identity.public void setWorld(TWorld world)
world
- the world to set.public TWorld getWorld()
public void addRoom(TRoom room)
room
- the Room.public TRoom getRoomByIdentity(java.lang.String identity)
identity
- the Room's identity.public void addObject(TObject object)
object
- the Object.public TObject getObjectByIdentity(java.lang.String identity)
identity
- the Object's identity.public void addContainer(TContainer container)
container
- the container.public TContainer getContainerByIdentity(java.lang.String identity)
identity
- the container's identity.public void addPlayer(TPlayer player)
player
- the Player's identity.public TPlayer getPlayerByIdentity(java.lang.String identity)
identity
- the Player's identity.public TElement getElementByIdentity(java.lang.String identity)
identity
- the element's identity.public int getPlayerCount()
public int getActionCount()
public int getRoomCount()
public int getObjectCount()
public int getContainerCount()
public java.lang.Iterable<java.util.Map.Entry<java.lang.String,TPlayer>> getPlayerList()
public java.lang.Iterable<java.util.Map.Entry<java.lang.String,TAction>> getActionList()
public java.lang.Iterable<java.util.Map.Entry<java.lang.String,TRoom>> getRoomList()
public java.lang.Iterable<java.util.Map.Entry<java.lang.String,TObject>> getObjectList()
public java.lang.Iterable<java.util.Map.Entry<java.lang.String,TContainer>> getContainerList()
public byte[] calculateDigest()
ModuleException
- if it cannot be calculated.public void writeBytes(java.io.OutputStream out) throws java.io.IOException
Saveable
writeBytes
in interface Saveable
out
- the output stream to write to.java.io.IOException
- if a write problem occurs.public void readBytes(java.io.InputStream in) throws java.io.IOException
Saveable