Package game.controllers.pacman
Class PacManControllerBase
java.lang.Object
game.controllers.pacman.PacManControllerBase
- All Implemented Interfaces:
IPacManController
- Direct Known Subclasses:
PacManHijackController
public abstract class PacManControllerBase extends java.lang.Object implements IPacManController
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PacManControllerBase()
-
Method Summary
Modifier and Type Method Description PacManAction
getAction()
ReturnPacManAction
containing Ms Pac-Man decision, what to do next.void
killed()
MS PacMan has been just eaten by a ghost.void
nextLevel(Game game)
Level has been changed!void
reset(Game game)
Resets the controller before game starts.abstract void
tick(Game game, long timeDue)
Perform action-selection based on information fromGame
.
-
Field Details
-
Constructor Details
-
PacManControllerBase
public PacManControllerBase()
-
-
Method Details
-
reset
Description copied from interface:IPacManController
Resets the controller before game starts.- Specified by:
reset
in interfaceIPacManController
- Parameters:
game
- initial state of the game
-
nextLevel
Description copied from interface:IPacManController
Level has been changed!- Specified by:
nextLevel
in interfaceIPacManController
-
tick
Description copied from interface:IPacManController
Perform action-selection based on information fromGame
.
Persist your decision withinPacManAction
that is periodically read viaIPacManController.getAction()
.- Specified by:
tick
in interfaceIPacManController
- Parameters:
game
- current state of the gametimeDue
- how much time (in millis) do you have for your action-selection beforeIPacManController.getAction()
will get called.
-
killed
public void killed()Description copied from interface:IPacManController
MS PacMan has been just eaten by a ghost.- Specified by:
killed
in interfaceIPacManController
-
getAction
Description copied from interface:IPacManController
ReturnPacManAction
containing Ms Pac-Man decision, what to do next.- Specified by:
getAction
in interfaceIPacManController
- Returns:
-