/*<summary> * Handles the user SwinGame. *</summary> *<remarks> * Reads key and mouse input and converts these into * actions for the game to perform. The actions * performed depend upon the state of the game. *</remarks> */ public static void HandleUserInput() { // Read incoming input events SwinGame.ProcessEvents(); switch (CurrentState) { case GameState.ViewingMainMenu: MenuController.HandleMainMenuInput(); break; case GameState.ViewingGameMenu: MenuController.HandleGameMenuInput(); break; case GameState.AlteringSettings: MenuController.HandleSetupMenuInput(); break; case GameState.AlteringShips: MenuController.HandleShipsMenuInput(); break; case GameState.Deploying: DeploymentController.HandleDeploymentInput(); break; case GameState.Discovering: DiscoveryController.HandleDiscoveryInput(); break; case GameState.EndingGame: EndingGameController.HandleEndOfGameInput(); break; case GameState.ViewingHighScores: HighScoreController.HandleHighScoreInput(); break; } UtilityFunctions.UpdateAnimations(); }
/// <summary> /// Handles the user SwinGame. /// </summary> /// <remarks> /// Reads key and mouse input and converts these into /// actions for the game to perform. The actions /// performed depend upon the state of the game. /// </remarks> public void HandleUserInput() { //Read incoming input events SwinGame.ProcessEvents(); switch (CurrentState) { case GameState.ViewingMainMenu: _menu.HandleMainMenuInput(this); break; case GameState.ViewingGameMenu: _menu.HandleGameMenuInput(this); break; case GameState.AlteringSettings: _menu.HandleSetupMenuInput(this); break; case GameState.Deploying: _deployment.HandleDeploymentInput(this); _menu.HandleSetupMenuInput(this); break; case GameState.Discovering: _discovery.HandleDiscoveryInput(this); break; case GameState.EndingGame: _endGame.HandleEndOfGameInput(this); break; case GameState.ViewingHighScores: _highScore.HandleHighScoreInput(this); break; } _utility.UpdateAnimations(); }