Package game.core
Interface Game
public interface Game
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classGame.DM -
Field Summary
Fields Modifier and Type Field Description static intCOMMON_LAIR_TIMEstatic intDOWNstatic intEAT_DISTANCEstatic intEDIBLE_TIMEstatic floatEDIBLE_TIME_REDUCTIONstatic intEMPTYstatic intEXTRA_LIFE_SCOREstatic intGHOST_EAT_SCOREstatic floatGHOST_REVERSALstatic intGHOST_SPEED_REDUCTIONstatic int[]INITIAL_GHOST_DIRSstatic intINITIAL_PAC_DIRstatic floatLAIR_REDUCTIONstatic int[]LAIR_TIMESstatic intLEFTstatic intLEVEL_LIMITstatic intMAX_LEVELSstatic intNUM_GHOSTSstatic intNUM_LIVESstatic intNUM_MAZESstatic intPILLstatic intPOWER_PILLstatic intRIGHTstatic intUP -
Method Summary
Modifier and Type Method Description int[]advanceGame(PacManAction pacMan, GhostsActions ghosts)booleancheckPill(int pillIndex)booleancheckPowerPill(int powerPillIndex)Gamecopy()booleangameOver()intgetCurGhostDir(int whichGhost)intgetCurGhostLoc(int whichGhost)intgetCurLevel()intgetCurMaze()intgetCurPacManDir()intgetCurPacManLoc()intgetEdibleTime(int whichGhost)doublegetEuclideanDistance(int from, int to)int[]getGhostNeighbours(int whichGhost)int[]getGhostPath(int whichGhost, int to)intgetGhostPathDistance(int whichGhost, int to)intgetGhostTarget(int from, int[] targets, boolean nearest)intgetInitialGhostsPosition()intgetInitialPacPosition()int[]getJunctionIndices()intgetLairTime(int whichGhost)intgetLevelTime()intgetLivesRemaining()intgetManhattanDistance(int from, int to)java.lang.StringgetName()intgetNeighbour(int nodeIndex, int direction)intgetNextEdibleGhostScore()intgetNextGhostDir(int whichGhost, int to, boolean closer, Game.DM measure)intgetNextPacManDir(int to, boolean closer, Game.DM measure)intgetNumActivePills()intgetNumActivePowerPills()intgetNumberOfNodes()intgetNumberPills()intgetNumberPowerPills()intgetNumNeighbours(int nodeIndex)int[]getPacManNeighbours()int[]getPath(int from, int to)intgetPathDistance(int from, int to)intgetPillIndex(int nodeIndex)int[]getPillIndices()int[]getPillIndicesActive()int[]getPossibleDirs(int curLoc, int curDir, boolean includeReverse)int[]getPossibleGhostDirs(int whichGhost)int[]getPossiblePacManDirs(boolean includeReverse)intgetPowerPillIndex(int nodeIndex)int[]getPowerPillIndices()int[]getPowerPillIndicesActive()intgetReverse(int direction)intgetScore()intgetTarget(int from, int[] targets, boolean nearest, Game.DM measure)intgetTotalTime()intgetX(int nodeIndex)intgetY(int nodeIndex)booleanghostRequiresAction(int whichGhost)booleanisEdible(int whichGhost)booleanisJunction(int nodeIndex)
-
Field Details
-
UP
static final int UP- See Also:
- Constant Field Values
-
RIGHT
static final int RIGHT- See Also:
- Constant Field Values
-
DOWN
static final int DOWN- See Also:
- Constant Field Values
-
LEFT
static final int LEFT- See Also:
- Constant Field Values
-
EMPTY
static final int EMPTY- See Also:
- Constant Field Values
-
PILL
static final int PILL- See Also:
- Constant Field Values
-
POWER_PILL
static final int POWER_PILL- See Also:
- Constant Field Values
-
GHOST_EAT_SCORE
static final int GHOST_EAT_SCORE- See Also:
- Constant Field Values
-
EDIBLE_TIME
static final int EDIBLE_TIME- See Also:
- Constant Field Values
-
EDIBLE_TIME_REDUCTION
static final float EDIBLE_TIME_REDUCTION- See Also:
- Constant Field Values
-
LAIR_TIMES
static final int[] LAIR_TIMES -
COMMON_LAIR_TIME
static final int COMMON_LAIR_TIME- See Also:
- Constant Field Values
-
LAIR_REDUCTION
static final float LAIR_REDUCTION- See Also:
- Constant Field Values
-
LEVEL_LIMIT
static final int LEVEL_LIMIT- See Also:
- Constant Field Values
-
GHOST_REVERSAL
static final float GHOST_REVERSAL- See Also:
- Constant Field Values
-
MAX_LEVELS
static final int MAX_LEVELS- See Also:
- Constant Field Values
-
EXTRA_LIFE_SCORE
static final int EXTRA_LIFE_SCORE- See Also:
- Constant Field Values
-
EAT_DISTANCE
static final int EAT_DISTANCE- See Also:
- Constant Field Values
-
NUM_GHOSTS
static final int NUM_GHOSTS- See Also:
- Constant Field Values
-
NUM_MAZES
static final int NUM_MAZES- See Also:
- Constant Field Values
-
NUM_LIVES
static final int NUM_LIVES- See Also:
- Constant Field Values
-
INITIAL_PAC_DIR
static final int INITIAL_PAC_DIR- See Also:
- Constant Field Values
-
INITIAL_GHOST_DIRS
static final int[] INITIAL_GHOST_DIRS -
GHOST_SPEED_REDUCTION
static final int GHOST_SPEED_REDUCTION- See Also:
- Constant Field Values
-
-
Method Details
-
copy
Game copy() -
advanceGame
-
getReverse
int getReverse(int direction) -
gameOver
boolean gameOver() -
checkPill
boolean checkPill(int pillIndex) -
checkPowerPill
boolean checkPowerPill(int powerPillIndex) -
getPacManNeighbours
int[] getPacManNeighbours() -
getGhostNeighbours
int[] getGhostNeighbours(int whichGhost) -
getCurLevel
int getCurLevel() -
getCurMaze
int getCurMaze() -
getCurPacManLoc
int getCurPacManLoc() -
getCurPacManDir
int getCurPacManDir() -
getLivesRemaining
int getLivesRemaining() -
getCurGhostLoc
int getCurGhostLoc(int whichGhost) -
getCurGhostDir
int getCurGhostDir(int whichGhost) -
getEdibleTime
int getEdibleTime(int whichGhost) -
isEdible
boolean isEdible(int whichGhost) -
getScore
int getScore() -
getLevelTime
int getLevelTime() -
getTotalTime
int getTotalTime() -
getNumberPills
int getNumberPills() -
getNumberPowerPills
int getNumberPowerPills() -
getLairTime
int getLairTime(int whichGhost) -
ghostRequiresAction
boolean ghostRequiresAction(int whichGhost) -
getName
java.lang.String getName() -
getInitialPacPosition
int getInitialPacPosition() -
getInitialGhostsPosition
int getInitialGhostsPosition() -
getNumberOfNodes
int getNumberOfNodes() -
getX
int getX(int nodeIndex) -
getY
int getY(int nodeIndex) -
getPillIndex
int getPillIndex(int nodeIndex) -
getPowerPillIndex
int getPowerPillIndex(int nodeIndex) -
getNeighbour
int getNeighbour(int nodeIndex, int direction) -
getPillIndices
int[] getPillIndices() -
getPowerPillIndices
int[] getPowerPillIndices() -
getJunctionIndices
int[] getJunctionIndices() -
getNextEdibleGhostScore
int getNextEdibleGhostScore() -
getNumActivePills
int getNumActivePills() -
getNumActivePowerPills
int getNumActivePowerPills() -
getPillIndicesActive
int[] getPillIndicesActive() -
getPowerPillIndicesActive
int[] getPowerPillIndicesActive() -
isJunction
boolean isJunction(int nodeIndex) -
getNumNeighbours
int getNumNeighbours(int nodeIndex) -
getNextPacManDir
-
getNextGhostDir
-
getPathDistance
int getPathDistance(int from, int to) -
getEuclideanDistance
double getEuclideanDistance(int from, int to) -
getManhattanDistance
int getManhattanDistance(int from, int to) -
getPossiblePacManDirs
int[] getPossiblePacManDirs(boolean includeReverse) -
getPossibleGhostDirs
int[] getPossibleGhostDirs(int whichGhost) -
getPossibleDirs
int[] getPossibleDirs(int curLoc, int curDir, boolean includeReverse) -
getPath
int[] getPath(int from, int to) -
getGhostPath
int[] getGhostPath(int whichGhost, int to) -
getTarget
-
getGhostTarget
int getGhostTarget(int from, int[] targets, boolean nearest) -
getGhostPathDistance
int getGhostPathDistance(int whichGhost, int to)
-