|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.ou.pacman.ImmutablePacmanState
public class ImmutablePacmanState
Constructor Summary | |
---|---|
ImmutablePacmanState(GameBoard game)
|
Method Summary | |
---|---|
java.util.ArrayList<Location2D> |
bonusItemLocations()
Get the location of all bonus items still available. |
boolean |
canMove(CharacterType character,
Direction direction)
Determine whether a character can move in a given direction. |
boolean[] |
canMoveFromLocation(Location2D location)
Method to determine what directions can be taken from a given location. |
Location2D |
getCharacterLocation(CharacterType character)
Get the location of the given character for the current world state. |
java.util.ArrayList<Location2D> |
ghostLocations()
Return the locations of the ghosts in the world. |
Location2D |
goalState()
Return the location that represents the goal for the map. |
int |
height()
The amount of rows in the game board. |
boolean |
pelletInDirection(CharacterType character,
Direction direction)
Check whether a pellet is available in a given direction for the character. |
java.util.ArrayList<Location2D> |
pelletLocations()
Get the locations of all available pellets. |
java.util.ArrayList<Location2D> |
powerPelletLocations()
Get the locations of all available power pellets. |
Location2D |
simulatePacmanMoveFromLocation(Location2D startingLocation,
Direction direction)
Pretends to move pacman from the specified location in the specified direction. |
boolean |
upgraded()
Whether Pac-man is in a state in which he can eat the ghosts. |
int |
width()
The amount of columns in the gameBoard. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImmutablePacmanState(GameBoard game)
Method Detail |
---|
public java.util.ArrayList<Location2D> bonusItemLocations()
public boolean canMove(CharacterType character, Direction direction)
character
- - The character to test fordirection
- - The direction to move
public boolean[] canMoveFromLocation(Location2D location)
location
- - The location to check for possible movement from.
public Location2D getCharacterLocation(CharacterType character)
character
- - The character to get the location for.
public int height()
public java.util.ArrayList<Location2D> ghostLocations()
public Location2D goalState()
public boolean pelletInDirection(CharacterType character, Direction direction)
character
- - The character to check if a pellet is close todirection
- - The direction to move the character
public java.util.ArrayList<Location2D> pelletLocations()
public java.util.ArrayList<Location2D> powerPelletLocations()
public int width()
public Location2D simulatePacmanMoveFromLocation(Location2D startingLocation, Direction direction)
public boolean upgraded()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |