private void setDefaultGameConfiguration() { PlayerConfiguration playerOneConfiguration = new PlayerConfiguration(); m_GameConfiguration = new GameConfiguration(); playerOneConfiguration.PlayerType = ePlayerTypes.Human; playerOneConfiguration.PlayerName = "Player 1"; m_GameConfiguration.AddPlayerConfiguration(playerOneConfiguration); m_GameConfiguration.GameMode = eGameModes.OnePlayerGame; m_GameConfiguration.BoardSize = 6; }
private GameConfiguration createGameConfiguration() { GameConfiguration gameConfiguration = new GameConfiguration(); PlayerConfiguration playerOneConfiguration = getPlayerOneConfiguration(); PlayerConfiguration playerTwoConfiguration; gameConfiguration.AddPlayerConfiguration(playerOneConfiguration); gameConfiguration.BoardSize = getBoardSize(); if (checkBoxPlayerTwo.Checked == true) { playerTwoConfiguration = getPlayerTwoConfiguration(); gameConfiguration.AddPlayerConfiguration(playerTwoConfiguration); gameConfiguration.GameMode = eGameModes.TwoPlayersGame; } else { gameConfiguration.GameMode = eGameModes.OnePlayerGame; ////add a second player as a computer. } return(gameConfiguration); }
private void initializeGame() { int currentPlayer = 1; GameConfiguration gameConfiguration = new GameConfiguration(); PlayerConfiguration mainPlayerConfiguration = new PlayerConfiguration(); mainPlayerConfiguration.PlayerName = UIManager.GetPlayerName(currentPlayer); mainPlayerConfiguration.PlayerType = ePlayerTypes.Human; gameConfiguration.AddPlayerConfiguration(mainPlayerConfiguration); gameConfiguration.BoardSize = UIManager.GetBoardSize(); gameConfiguration.GameMode = UIManager.GetGameMode(); if (gameConfiguration.GameMode == eGameModes.TwoPlayersGame) { PlayerConfiguration secondaryPlayerConfiguration = new PlayerConfiguration(); currentPlayer++; secondaryPlayerConfiguration.PlayerName = UIManager.GetPlayerName(currentPlayer); secondaryPlayerConfiguration.PlayerType = ePlayerTypes.Human; gameConfiguration.AddPlayerConfiguration(secondaryPlayerConfiguration); } m_GameManager.InitializeGame(gameConfiguration); }