public interface Matrix
AbstractMatrix
Modifier and Type | Method and Description |
---|---|
void |
addAgent(Agent agent)
Adds an Agent to this Matrix
|
void |
addKey(Key key)
Adds a Key to this Matrix
|
void |
addToken(Token token)
Adds a Token to this Matrix
|
void |
clearAgents()
Clears the Agents in this Matrix
|
void |
clearKeys()
Clears the List of Keys in this Matrix
|
void |
clearTokens()
Removes all Tokens from this Matrix's grid
|
boolean |
contains(NetPuzlObject npo)
Determines if this Matrix contains the given NetPuzlObject
|
boolean |
containsImage(Image image)
Determines if this Matrix contains the given Image
|
boolean |
containsToken(Token token)
Determines if this Matrix contains the given Token
|
TSet |
createSetTag()
Creates a set Tag for this Matrix to be sent to a client
|
java.util.List<TSet> |
createSetTags()
Creates setTtags for this Matrix and its Tokens, Keys, and Agents to be
sent to a client
|
java.util.List<TSet> |
createTokenSetTags()
Creates set Tags for this Matrix's Tokens to be sent to a client
|
void |
doSpokenCommand(java.lang.String text)
Performs the command spoken to this Matrix
|
int |
getAgentCount()
Gets the number of Agents in this Matrix.
|
java.util.Iterator<Agent> |
getAgentIterator()
Gets an iterator over the elements in the container for agents.
|
java.util.Set<Agent> |
getAgents()
Gets the Set of Agents in this Matrix
|
Attributes |
getAttributes()
Gets the attributes of this Matrix
|
Cell[][] |
getGrid()
A method used for testing that returns a reference to the 2-dimensional
cell array or grid.
|
Cell |
getGridCell(int i,
int j)
This method returns a particular Cell in the grid from the specified
coordinates.
|
int |
getHeight()
This method is used to get how tall the matrix is.
|
int |
getImageCount()
Gets the number of Images from this Matrix, including images from the
Matrix's Agents and Tokens
|
int |
getKeyCount()
Gets the number of Keys from this Matrix.
|
java.util.Iterator<Key> |
getKeyIterator()
Gets an iterator over the elements in the container for keys.
|
ObjID |
getObjID()
Gets the object ID of this Matrix
|
SayFunction |
getSayFunction()
Gets the function that processes spoken commands for this Matrix
|
AbstractMatrix |
getThis()
Gets this Matrix for use in anonymous classes
|
int |
getTokenCount()
Gets the number of Tokens in this Matrix
|
java.util.List<Token> |
getTokens()
Gets the List of Tokens from this Matrix's grid
|
int |
getWidth()
This method is used to get how wide the matrix is.
|
boolean |
hasSpokenCommand()
Determines if this Matrix has a function to process spoken commands
|
void |
initCells()
Initializes the Cells contained in this Matrix to their associated x and
y coordinates
|
void |
removeAgent(Agent agent)
Removes an agent from this Matrix
|
void |
removeKey(Key key)
Removes a key from this Matrix
|
void |
removeToken(Token token)
Removes a Token from this Matrix
|
void |
sendHearTagToMatrix(NetPuzlObject from,
NetPuzlObject to,
java.lang.String text)
Sends a 'hear' Tag from one NetPuzlObject to another to be broadcast to
all Agents in this Matrix
|
void |
sendHearTagToNPO(NetPuzlClientProxy proxy,
NetPuzlObject from,
NetPuzlObject to,
java.lang.String text)
Sends a 'hear' Tag from one NetPuzlObject to another to be broadcast to
the Agent involved
|
void |
sendToAgentsInMatrix(Tag t)
Sends a tag to all Agents in this Matrix
|
void |
setGrid(Cell[][] newGrid)
A method used for testing that forces the grid to be the one that is
given as a parameter.
|
void |
setGridCell(int i,
int j,
Cell cell)
A method used for testing that simply lets you set a Cell in the grid.
|
void |
setSayFunction(SayFunction sayFunction)
Sets the function that processes spoken commands for this Matrix
|
java.lang.String |
toString()
Every Matrix in a NetPuzl world will have its own String representation
|
void addAgent(Agent agent)
agent
- The Agent to add to this Matrixvoid addKey(Key key)
key
- The Key to add to this Matrixvoid addToken(Token token)
token
- The Token to add to this Matrixvoid clearAgents()
void clearKeys()
void clearTokens()
boolean contains(NetPuzlObject npo)
npo
- The NetPuzlObject to check for in this Matrixboolean containsImage(Image image)
image
- The Image to check for in this Matrixboolean containsToken(Token token)
token
- The Token to check for in this MatrixTSet createSetTag()
java.util.List<TSet> createSetTags()
java.util.List<TSet> createTokenSetTags()
void doSpokenCommand(java.lang.String text)
text
- The command spoken to this Matrixint getAgentCount()
java.util.Iterator<Agent> getAgentIterator()
java.util.Set<Agent> getAgents()
Attributes getAttributes()
Cell[][] getGrid()
Cell getGridCell(int i, int j)
i
- The column of the cell you want.j
- The row of the Cell you want.int getHeight()
int getImageCount()
int getKeyCount()
java.util.Iterator<Key> getKeyIterator()
ObjID getObjID()
SayFunction getSayFunction()
AbstractMatrix getThis()
int getTokenCount()
java.util.List<Token> getTokens()
int getWidth()
boolean hasSpokenCommand()
void initCells()
void removeAgent(Agent agent)
agent
- The Agent to remove from this Matrixvoid removeKey(Key key)
key
- Key to remove from this Matrixvoid removeToken(Token token)
token
- The Token to remove from this Matrixvoid sendHearTagToMatrix(NetPuzlObject from, NetPuzlObject to, java.lang.String text)
from
- The NetPuzlObject to send the Tag fromto
- The NetPuzlObject to send the Tag totext
- The message contained in the Tagvoid sendHearTagToNPO(NetPuzlClientProxy proxy, NetPuzlObject from, NetPuzlObject to, java.lang.String text)
proxy
- The client proxy to send the Tag tofrom
- The NetPuzlObject to send the Tag fromto
- The NetPuzlObject to send the Tag totext
- The message contained in the Tagvoid sendToAgentsInMatrix(Tag t)
t
- The tag to send to all Agents in this Matrixvoid setGrid(Cell[][] newGrid)
newGrid
- What the old grid should look like.void setGridCell(int i, int j, Cell cell)
i
- What column.j
- What row.cell
- What to set the grid location to.void setSayFunction(SayFunction sayFunction)
sayFunction
- The function that processes spoken commands to set
this Matrix tojava.lang.String toString()
toString
in class java.lang.Object