gcspy.interpreter.server
Class ServerSpace

java.lang.Object
  extended by gcspy.interpreter.Space
      extended by gcspy.interpreter.server.ServerSpace

public class ServerSpace
extends Space

Represents a server-side space

Author:
Tony Printezis

Field Summary
 
Fields inherited from class gcspy.interpreter.Space
blockInfo, control, CONTROL_BACKGROUND, CONTROL_LINK, CONTROL_SEPARATOR, CONTROL_UNUSED, CONTROL_USED, DEFAULT_UNUSED_STRING, driverName, id, mainSpace, name, spaceInfo, streamNum, streams, tileNames, tileNum, title, unusedString
 
Constructor Summary
ServerSpace()
          Create an empty server space.
ServerSpace(java.lang.String name, java.lang.String driverName, int tileNum, java.lang.String title, java.lang.String blockInfo, int streamNum, java.lang.String unusedString, boolean mainSpace)
          Create a new server space
 
Method Summary
 int addStream(Stream stream)
          Add a stream to this space
 void finishControl()
           
 void flagChanged()
          This space has changed
 int getTilesToSend()
          Get the number of tiles to send
 boolean hasChanged()
          Has this space changed?
 void resetData()
          Reset the data in every stream
 void resize(int tileNum)
          Resize this space
 void setControl(byte tag, int index)
          Set the control for a tile
 void setControlRange(byte tag, int start, int len)
          Set the control values for a range of tiles
 void setData(int tileNum)
          Set the data for each stream in this space
 void setTileName(int tile, java.lang.String name)
          Set a tile's name
 void startControl()
          Initialise the control values for this space
 void unflagChanged()
          This space has not changed
 
Methods inherited from class gcspy.interpreter.Space
deserialise, dump, getBlockInfo, getControl, getFullName, getID, getName, getSpaceInfo, getStream, getStreamNum, getTileName, getTileNum, getTitle, getUnusedString, initControl, isControlBackground, isControlLink, isControlSeparator, isControlUnused, isControlUsed, isMainSpace, serialise, setControl, setID, setSpaceInfo, setupControl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerSpace

public ServerSpace()
Create an empty server space. Initially it has no tiles to send


ServerSpace

public ServerSpace(java.lang.String name,
                   java.lang.String driverName,
                   int tileNum,
                   java.lang.String title,
                   java.lang.String blockInfo,
                   int streamNum,
                   java.lang.String unusedString,
                   boolean mainSpace)
Create a new server space

Parameters:
name - The space's name
driverName - Its driver's name
tileNum - The number of tiles in the space
title - The title to use
blockInfo - The block information tile to use
streamNum - The number of streams in the space
unusedString - The string to use for unused tiles
mainSpace - Is this the main space?
Method Detail

setTileName

public void setTileName(int tile,
                        java.lang.String name)
Set a tile's name

Parameters:
tile - the tile index
name - the name of the tile

setData

public void setData(int tileNum)
Set the data for each stream in this space

Parameters:
tileNum - The number of tiles in the space

flagChanged

public void flagChanged()
This space has changed


unflagChanged

public void unflagChanged()
This space has not changed


getTilesToSend

public int getTilesToSend()
Get the number of tiles to send

Returns:
the number of tiles to send

hasChanged

public boolean hasChanged()
Has this space changed?

Returns:
true if this space has changed

addStream

public int addStream(Stream stream)
Add a stream to this space

Parameters:
stream - The stream to add
Returns:
An ID for this stream

resetData

public void resetData()
Reset the data in every stream


resize

public void resize(int tileNum)
Resize this space

Parameters:
tileNum - The number of tiles in the resized space

startControl

public void startControl()
Initialise the control values for this space


setControlRange

public void setControlRange(byte tag,
                            int start,
                            int len)
Set the control values for a range of tiles

Parameters:
tag - The control value
start - The starting tile
len - The number of tiles

setControl

public void setControl(byte tag,
                       int index)
Set the control for a tile

Parameters:
tag - The control value
index - The tile index

finishControl

public void finishControl()