private Checkers_LogicAndDataSection.InitialGameSetting setup() { Checkers_LogicAndDataSection.InitialGameSetting res = new Checkers_LogicAndDataSection.InitialGameSetting(); res.player1Name = "amir"; res.player2Name = "ori"; res.gameType = Checkers_LogicAndDataSection.eTypeOfGame.doublePlayer; res.boardSize = Checkers_LogicAndDataSection.eBoardSizeOptions.MediumBoard; return(res); }
public static void InitializePlayers(InitialGameSetting i_NameSettings) { s_Player1.InitializePlayer(i_NameSettings.GetPlayerName(ePlayerOptions.Player1), Checkers_LogicAndDataSection.ePlayerOptions.Player1); switch (Checkers_LogicAndDataSection.SessionData.s_GameType) { case Checkers_LogicAndDataSection.eTypeOfGame.singlePlayer: s_Player2.InitializePlayer("PC", Checkers_LogicAndDataSection.ePlayerOptions.ComputerPlayer); m_TheOtherPlayer = ePlayerOptions.ComputerPlayer; break; case Checkers_LogicAndDataSection.eTypeOfGame.doublePlayer: s_Player2.InitializePlayer(i_NameSettings.GetPlayerName(ePlayerOptions.Player2), Checkers_LogicAndDataSection.ePlayerOptions.Player2); m_TheOtherPlayer = ePlayerOptions.Player2; break; } }
public void RunCheckersGame() { m_IsGameOn = true; Checkers_LogicAndDataSection.InitialGameSetting GameDemoSettings = setup();//Checkers_UI.class.setup Checkers_LogicAndDataSection.SessionData.initializeSessionData(GameDemoSettings); InitializePlayers(GameDemoSettings); InitializeGameBoard(); while (m_IsGameOn) { m_currentActivePlayer = GetNextPlayer(); while (!m_isRequestedMoveLegal) { m_RequestedMove = UI.ReadAndCheckInput(); if (Checkers_LogicAndDataSection.GameBoard.CheckIfMoveIsOk(m_RequestedMove)) { m_isRequestedMoveLegal = true; } } m_currentActivePlayer.MakeAMove(m_RequestedMove, m_CheckersBoard); //at the end of this method - we are ready to get the next move in the game } }
public static void initializeSessionData(InitialGameSetting gameSettings) { m_BoardSize = gameSettings.boardSize; gameType = gameSettings.gameType; }
public static void initializeSessionData(InitialGameSetting gameSettings) { m_BoardSize = gameSettings.GetBoardSize(); s_GameType = gameSettings.GetGameType(); }