//Multiplayer Constructor// public static void newGame(int nbrPlayers, List <String> playerName, Network.Client client, int portServer) { port = portServer; playerClient = client; isMultiPlayer = true; Properties.Settings.Default.nbrPlayers = nbrPlayers; client.getName(); owner = Game.Instance.addPlayer(playerClient.getName(), true, 0); int idx = 1; foreach (String str in playerName) { //Ajout des autres joueurs if (str != playerClient.getName()) { Player add = Game.Instance.addPlayer(str, true, idx); idx++; } } game_window_multi gw = new game_window_multi(); gameView = gw; gameView.Shown += new EventHandler(gameViewLoaded); gameView.ShowDialog(); }
public static void RoundOver(String data) { Player p = Game.Instance.getPlayerByName(data); p.nbMarker += 1; Game.Instance.roundNumber += 1; GameControllerMulti.gameView.showMessage(String.Format(Properties._string.IsTheLastPlayer, p.name), true); Boolean mutedTemp = GameControllerMulti.gameView.muted; double mainTemp = GameControllerMulti.gameView.mainVolume; double musicTemp = GameControllerMulti.gameView.musicVolume; double effectTemp = GameControllerMulti.gameView.effectVolume; GameControllerMulti.gameView.endOfround(); GameControllerMulti.gameView = new game_window_multi(mutedTemp, mainTemp, musicTemp, effectTemp); gameView.Shown += new EventHandler(gameViewLoaded); gameView.ShowDialog(); }