Package com.edu.xmum.CST210.Controller
Interface IGameController
- All Known Implementing Classes:
GameController,GameControllerVs
public interface IGameController
-
Method Summary
Modifier and TypeMethodDescriptionGets the current difficulty level of the game.Gets the game service, which handles game logic and operations.voidhandleKeyPress(String key) Handles key press events to control game actions.voidResets the game to its initial state.voidsetDifficulty(String difficulty) Sets the difficulty level of the game.voidsetGameView(IGameView gameView) Sets the game view, which is responsible for the user interface.voidDisplays the failure view when the player loses the game.voidshowHint()Displays a hint to the player during the game.voidDisplays the preparation view before starting the game.voidDisplays the main game view where the game is played.voidDisplays the selection view where users can choose game settings.voidshowVictoryView(String winner) Displays the victory view when the player wins the game.voidStarts the AI movement in the game.voidStarts the game by initializing necessary components and setting up the initial state.
-
Method Details
-
startGame
void startGame()Starts the game by initializing necessary components and setting up the initial state. -
resetGame
void resetGame()Resets the game to its initial state. -
handleKeyPress
Handles key press events to control game actions.- Parameters:
key- The key pressed by the user.
-
showSelectionView
void showSelectionView()Displays the selection view where users can choose game settings. -
showPrepareView
void showPrepareView()Displays the preparation view before starting the game. -
showRunView
void showRunView()Displays the main game view where the game is played. -
showVictoryView
Displays the victory view when the player wins the game.- Parameters:
winner- The winner of the game.
-
showHint
void showHint()Displays a hint to the player during the game. -
showFailureView
void showFailureView()Displays the failure view when the player loses the game. -
setGameView
Sets the game view, which is responsible for the user interface.- Parameters:
gameView- The game view to set.
-
getDifficulty
String getDifficulty()Gets the current difficulty level of the game.- Returns:
- The current difficulty level.
-
setDifficulty
Sets the difficulty level of the game.- Parameters:
difficulty- The difficulty level to set (e.g., Easy, Medium, Hard).
-
getGameService
IGameService getGameService()Gets the game service, which handles game logic and operations.- Returns:
- The game service.
-
startAiMovement
void startAiMovement()Starts the AI movement in the game.
-