Package game.controllers.ghosts
Interface IGhostsController
- All Known Implementing Classes:
AttractRepelGhosts,GameGhosts,GhostsControllerBase,Legacy,Legacy2TheReckoning,RandomGhosts,Replay.ReplayGhosts
public interface IGhostsController
Interface that Ghosts controllers must implement. The only method that is
required is getActions(-), which returns the direction to be taken:
Up - Right - Down - Left -> 0 - 1 - 2 - 3
Any other number is considered to be a lack of action (Neutral).
-
Method Summary
Modifier and Type Method Description GhostsActionsgetActions()ReturnGhostsActionscontaining Ghosts decision, what to do next.intgetGhostCount()How many ghosts (0-4) this controller control.voidnextLevel(Game game)Level has been changed!voidreset(Game game)Resets the controller before game starts.voidtick(Game game, long timeDue)Perform action-selection for all ghosts based on information fromGame.
-
Method Details
-
getGhostCount
int getGhostCount()How many ghosts (0-4) this controller control.- Returns:
-
reset
Resets the controller before game starts.- Parameters:
game- initial state of the game
-
nextLevel
Level has been changed!- Parameters:
game-
-
tick
Perform action-selection for all ghosts based on information fromGame.
Persist your decision withinPacManActionthat is periodically read via#getAction().- Parameters:
game- current state of the gametimeDue- how much time (in millis) do you have for your action-selection before#getAction()will get called.
-
getActions
GhostsActions getActions()ReturnGhostsActionscontaining Ghosts decision, what to do next.- Returns:
-