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 class
Maze.MazeNode
static class
Maze.NodeCategory
static class
Maze.NodeType
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Maze()
-
Method Summary
Modifier and Type Method Description Game
getGame()
Underlying game data.java.util.Set<java.lang.Integer>
getGhostLocationIndices()
Maze.MazeNode[]
getGhostLocations()
ReturnsMaze.MazeNode
with ghosts.java.util.Set<Maze.MazeNode>
getGhostLocationSet()
Returns set ofMaze.MazeNode
with ghosts.Maze.MazeNode
getNode(int nodeIndex)
Returns aMaze.MazeNode
for a given node index.Maze.MazeNode[]
getNodes()
Returns all existingMaze.MazeNode
s.int
getNumActivePills()
How many pills are currently within the maze?int
getNumActivePowerPills()
How many power-pills are currently within the maze?Maze.MazeNode
getPacManLocation()
ReturnsMaze.MazeNode
where the Ms Pac-Man stands.Maze.MazeNode[]
getPillIndicesActive()
Returns nodes with PILLS.Maze.MazeNode[]
getPowerPillIndicesActive()
Returns nodes with POWER-PILLS.Maze.MazeNode
getRandomNode()
Returns randomMaze.MazeNode
.void
reset(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.MazeNode
where the Ms Pac-Man stands.- Returns:
-
getNode
Returns aMaze.MazeNode
for a given node index.- Parameters:
nodeIndex
-- Returns:
-
getNodes
Returns all existingMaze.MazeNode
s.- Returns:
-
getRandomNode
Returns randomMaze.MazeNode
.- Returns:
-
getGame
Underlying game data.- Returns:
-
getGhostLocationIndices
public java.util.Set<java.lang.Integer> getGhostLocationIndices() -
getGhostLocations
ReturnsMaze.MazeNode
with ghosts.- Returns:
-
getGhostLocationSet
Returns set ofMaze.MazeNode
with ghosts.- Returns:
-