Package game.controllers.pacman.modules
Class Maze
java.lang.Object
game.controllers.pacman.modules.Maze
public class Maze
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classMaze.MazeNodestatic classMaze.NodeCategorystatic classMaze.NodeType -
Field Summary
-
Constructor Summary
Constructors Constructor Description Maze() -
Method Summary
Modifier and Type Method Description GamegetGame()Underlying game data.java.util.Set<java.lang.Integer>getGhostLocationIndices()Maze.MazeNode[]getGhostLocations()ReturnsMaze.MazeNodewith ghosts.java.util.Set<Maze.MazeNode>getGhostLocationSet()Returns set ofMaze.MazeNodewith ghosts.Maze.MazeNodegetNode(int nodeIndex)Returns aMaze.MazeNodefor a given node index.Maze.MazeNode[]getNodes()Returns all existingMaze.MazeNodes.intgetNumActivePills()How many pills are currently within the maze?intgetNumActivePowerPills()How many power-pills are currently within the maze?Maze.MazeNodegetPacManLocation()ReturnsMaze.MazeNodewhere the Ms Pac-Man stands.Maze.MazeNode[]getPillIndicesActive()Returns nodes with PILLS.Maze.MazeNode[]getPowerPillIndicesActive()Returns nodes with POWER-PILLS.Maze.MazeNodegetRandomNode()Returns randomMaze.MazeNode.voidreset(Game game)
-
Field Details
-
HEIGHT
public static final int HEIGHT- See Also:
- Constant Field Values
-
WIDTH
public static final int WIDTH- See Also:
- Constant Field Values
-
-
Constructor Details
-
Maze
public Maze()
-
-
Method Details
-
reset
-
getNumActivePills
public int getNumActivePills()How many pills are currently within the maze?- Returns:
-
getNumActivePowerPills
public int getNumActivePowerPills()How many power-pills are currently within the maze?- Returns:
-
getPillIndicesActive
Returns nodes with PILLS. Time complexity: O(n) !- Returns:
-
getPowerPillIndicesActive
Returns nodes with POWER-PILLS.- Returns:
-
getPacManLocation
ReturnsMaze.MazeNodewhere the Ms Pac-Man stands.- Returns:
-
getNode
Returns aMaze.MazeNodefor a given node index.- Parameters:
nodeIndex-- Returns:
-
getNodes
Returns all existingMaze.MazeNodes.- Returns:
-
getRandomNode
Returns randomMaze.MazeNode.- Returns:
-
getGame
Underlying game data.- Returns:
-
getGhostLocationIndices
public java.util.Set<java.lang.Integer> getGhostLocationIndices() -
getGhostLocations
ReturnsMaze.MazeNodewith ghosts.- Returns:
-
getGhostLocationSet
Returns set ofMaze.MazeNodewith ghosts.- Returns:
-