public class HeinekenMathMatrix extends AbstractHeinekenGame
Modifier and Type | Class and Description |
---|---|
private static class |
HeinekenMathMatrix.Equation
A class to represent an Equation stored by a game Token
|
Modifier and Type | Field and Description |
---|---|
private java.util.Map<Token,java.lang.Integer> |
answers
The table that links each game button with an answer
|
private java.util.List<HeinekenMathMatrix.Equation> |
equations
The Equations to be used in this Heineken Math game
|
private java.util.List<Token> |
gameTokens
The 64 game buttons of this Heineken Math game
|
Constructor and Description |
---|
HeinekenMathMatrix(ObjID objID,
Attributes attributes,
java.util.Map<ObjID,NetPuzlObject> cache)
Constructs a Heineken Math game with the given parameters
|
Modifier and Type | Method and Description |
---|---|
private void |
defaultHelpTokenBehavior(Agent agent,
Token help)
What the 'Help' button usually says when clicked or spoken to
|
private void |
fillAnswers()
Links each game Token to its Equation's answer and reveals the Tokens'
names and Equations
|
private void |
fillEquations()
Generates the Equations to be used in this Heineken Math game
|
private void |
getHelp(Agent agent)
Sends an Agent this Heineken Math game's rules
|
private void |
goHome(Agent agent)
Returns an Agent to Home Matrix
|
private void |
loadHelpToken()
Loads the 'Help' button of this Heineken Math game
|
private void |
loadHomeToken()
Loads the 'Home' button of this Heineken Math game
|
private void |
loadMathTokens()
Loads the math buttons of this Heineken Math game, sets them to inactive
status, and hides their names and text
|
private void |
loadMiscTokens()
Loads the 'Home', 'Help', 'Status', and 'Start' buttons of this Heineken
Math game
|
private void |
loadStartToken()
Loads the 'Start' button of this Heineken Math game
|
private void |
setTokenToSolved(Token token)
Sets a math button to 'SOLVED' status
|
private void |
startGame(Agent agent)
Starts this Heineken Math game
|
gameOver, getCache, getGameStatus, getNumSolved, getStartToken, getStatusToken, isReady, loadStatusToken, setAgentEnergy, setGameStatus, setNumSolved, setStartToken, setStatus, setStatusToken
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 java.util.List<Token> gameTokens
private java.util.List<HeinekenMathMatrix.Equation> equations
private java.util.Map<Token,java.lang.Integer> answers
public HeinekenMathMatrix(ObjID objID, Attributes attributes, java.util.Map<ObjID,NetPuzlObject> cache)
objID
- The object ID to construct with Heineken Math game withattributes
- The Attributes to construct this Heineken Math game
withcache
- The Map to cache this Heineken Math game inprivate void loadMiscTokens()
private void goHome(Agent agent)
agent
- The Agent to return to the Home Matrixprivate void loadHomeToken()
private void getHelp(Agent agent)
agent
- The Agent to send this Heineken Math game's rules toprivate void loadHelpToken()
private void defaultHelpTokenBehavior(Agent agent, Token help)
agent
- The Agent interacting with the 'Help' buttonhelp
- The 'Help' button clicked on or spoken toprivate void startGame(Agent agent)
agent
- The Agent that started this Heineken Math gameprivate void loadStartToken()
private void fillEquations()
private void fillAnswers()
private void loadMathTokens()
private void setTokenToSolved(Token token)
token
- The math button to set to 'SOLVED' status