public abstract class AbstractHeinekenGame extends AbstractMatrix
Modifier and Type | Field and Description |
---|---|
private java.util.Map<ObjID,NetPuzlObject> |
cache
The cache that links object IDs to their NetPuzlObjects
|
private StatusType |
gameStatus
The current status of this Heineken Math game
|
private int |
numSolved
The current number of solved squares in this Heineken game
|
private Token |
start
The 'Start' button of this Heineken game, or null if none
|
private Token |
status
The 'Status' button of this Heineken game
|
Constructor and Description |
---|
AbstractHeinekenGame(ObjID objID,
Attributes attributes,
java.util.Map<ObjID,NetPuzlObject> cache)
Constructs a Heineken game with the given parameters
|
Modifier and Type | Method and Description |
---|---|
void |
gameOver()
Determines the winner of this Heineken game, if any, and sends a
congratulations message to all Agents in the Matrix if it finds a winner
|
java.util.Map<ObjID,NetPuzlObject> |
getCache()
Gets the cache that links object IDs to their NetPuzlObjects
|
StatusType |
getGameStatus()
Gets the current status of this Heineken game
|
int |
getNumSolved()
Gets the current number of solved squares in this Heineken game
|
Token |
getStartToken()
Gets the 'Start' button of this Heineken game
|
Token |
getStatusToken()
Gets the 'Status' button of this Heineken game
|
boolean |
isReady()
Determines whether or not the game status is 'READY'
|
void |
loadStatusToken()
Loads the 'Status' Token of this Heineken game
|
void |
setAgentEnergy(Agent agent,
int energy)
Sets the energy Attribute of an Agent
|
void |
setGameStatus(StatusType gameStatus)
Sets the current game status of this Heineken game
|
void |
setNumSolved(int numSolved)
Sets the current number of solved squares in this Heineken game
|
void |
setStartToken(Token start)
Sets the 'Start' button of this Heineken game
|
void |
setStatus(StatusType statusType)
Sets the current status of this Heineken game
|
void |
setStatusToken(Token status)
Sets the 'Status' button of this Heineken game
|
addAgent, addKey, addToken, clearAgents, clearKeys, clearTokens, contains, containsImage, containsToken, createSetTag, createSetTags, createTokenSetTags, doSpokenCommand, fullToString, getAgentCount, getAgentIterator, getAgents, getGrid, getGridCell, getHeight, getImageCount, getKeyCount, getKeyIterator, getSayFunction, getThis, getTokenCount, getTokens, getWidth, hasSpokenCommand, initCells, removeAgent, removeKey, removeToken, sendHearTagToMatrix, sendHearTagToNPO, sendToAgentsInMatrix, setGrid, setGridCell, setSayFunction, toString
getAttributes, getObjID, setAttributes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAttributes, getObjID
private Token start
private Token status
private StatusType gameStatus
private java.util.Map<ObjID,NetPuzlObject> cache
private int numSolved
public AbstractHeinekenGame(ObjID objID, Attributes attributes, java.util.Map<ObjID,NetPuzlObject> cache)
objID
- The object ID to construct this Heineken game withattributes
- The Attributes to construct this Heineken game withcache
- The Map to cache this Heineken game inpublic void loadStatusToken()
public void setStatus(StatusType statusType)
statusType
- The StatusType to set this Heineken game topublic void setAgentEnergy(Agent agent, int energy)
agent
- The Agent whose energy to setenergy
- The energy to set the Agent's Attribute topublic void gameOver()
public Token getStartToken()
public void setStartToken(Token start)
start
- The 'Start' button to set this Heineken game topublic Token getStatusToken()
public void setStatusToken(Token status)
status
- The 'Status' button to set this Heineken game topublic StatusType getGameStatus()
public void setGameStatus(StatusType gameStatus)
gameStatus
- The current game status to set this Heineken game topublic boolean isReady()
public java.util.Map<ObjID,NetPuzlObject> getCache()
public int getNumSolved()
public void setNumSolved(int numSolved)
numSolved
- The current number of solved squares to set this
Heineken game to