org.almacha.achamaze
Class MazeSolvingAlgorithm
java.lang.Object
org.almacha.achamaze.MazeSolvingAlgorithm
- Direct Known Subclasses:
- FollowLeftWallAlgo, PledgeAlgorithm
public abstract class MazeSolvingAlgorithm
- extends java.lang.Object
A class from which derive the classes that implement maze solving algorithm.
- Author:
- almacha
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
playerState
private PlayerStateForMazeAlgo playerState
MazeSolvingAlgorithm
public MazeSolvingAlgorithm(PlayerStateForMazeAlgo playerState)
decide
protected abstract Direction decide()
- This method decides in which direction the player should go.
When this method is called, the player will then move in the
chosen direction. So your implementation of decide() can
assume that the player is moved in the direction you return.
This method should never be called directly,
even from derived classes, use move() instead.
- Returns:
- the chosen direction
move
public final void move()
throws PlayerCannotMoveException
- This method calls decide() to decide in which
direction to go. Then it moves in that direction.
- Throws:
PlayerCannotMoveException
getPlayerState
public PlayerStateForMazeAlgo getPlayerState()