/*! * \fn void updateRadio() * \brief Mise a jour des radioButton des des * \return */ public void updateRadio() { int playerNb = App.wrapper.getCurrentPlayer(); Utilities.GameSpaceshipsType type = (Utilities.GameSpaceshipsType)App.wrapper.getPlayerSpaceshipType(playerNb); if (type == Utilities.GameSpaceshipsType.Mothership) { mainGame.radioButtonSecondDice.IsEnabled = true; mainGame.radioButtonBothDices.IsEnabled = true; } else { mainGame.radioButtonSecondDice.IsEnabled = false; mainGame.radioButtonBothDices.IsEnabled = false; } }
/*! * \fn void updateSpaceshipType() * \brief Mise a jour du type du vaisseau du joueur * \return */ public void updateSpaceshipType() { int color = App.wrapper.getColorTab(playerNb); Utilities.GameSpaceshipsType oldType = spaceshipType; spaceshipType = (Utilities.GameSpaceshipsType)App.wrapper.getPlayerSpaceshipType(playerNb); String type = Utilities.spaceshipTypeToString(spaceshipType); if (spaceshipType > oldType) { mainGame.write(mainGame.strColorTab[playerNb] + "player's " + Utilities.spaceshipTypeToString(oldType) + " is now replaced by a " + type); player = new WMPLib.WindowsMediaPlayer(); var path = System.IO.Path.Combine( System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) , "sounds/hit.mp3"); player.URL = path; player.controls.play(); } if (spaceshipType < oldType) { mainGame.write(mainGame.strColorTab[playerNb] + "player's " + Utilities.spaceshipTypeToString(oldType) + " is now upgraded to a " + type); } }
/*! * \fn void updateSpaceshipType() * \brief Mise a jour du type du vaisseau du joueur * \return */ public void updateSpaceshipType() { int color = App.wrapper.getColorTab(playerNb); Utilities.GameSpaceshipsType oldType = spaceshipType; spaceshipType = (Utilities.GameSpaceshipsType)App.wrapper.getPlayerSpaceshipType(playerNb); String type = Utilities.spaceshipTypeToString(spaceshipType); if (spaceshipType > oldType) { mainGame.write(mainGame.strColorTab[playerNb] + "player's " + Utilities.spaceshipTypeToString(oldType) + " is now replaced by a " + type); player = new WMPLib.WindowsMediaPlayer(); var path = System.IO.Path.Combine( System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) , "sounds/hit.mp3"); player.URL = path; player.controls.play(); } if (spaceshipType < oldType) mainGame.write(mainGame.strColorTab[playerNb] + "player's " + Utilities.spaceshipTypeToString(oldType) + " is now upgraded to a " + type); }