private void restartGame() { Controls.Clear(); m_IsFirstPlayerTurn = true; InitializeComponents(); GameManager.m_FirstPlayer.Score = 0; GameManager.m_SecondPlayer.Score = 0; m_BoardGame = new BoardGameWindows(m_NumOfColums, m_NumOfRows); GameManager.StartGame(m_NumOfRows, m_NumOfColums, GameManager.m_FirstPlayer.Name, GameManager.m_SecondPlayer.Name, GameManager.m_SecondPlayer.IsHumanPlayer); CreateBoard(); }
private MemoryGameButton m_CurrentButtonClickedByPlayer; // Onlu used by a human player public MemoryGameWindows(int i_NumOfColumns, int i_NumOfRows, string i_FirstPlayerName, string i_SecondPlayerName, bool i_IsAgainstHuman, string i_ComputerLevel) { m_NumOfColums = i_NumOfColumns; m_NumOfRows = i_NumOfRows; GameManager.m_FirstPlayer = new Player(i_FirstPlayerName, v_HumanPlayer); GameManager.m_SecondPlayer = new Player(i_SecondPlayerName, i_IsAgainstHuman); m_ComputerLevel = i_ComputerLevel; m_GameImages = new Image[(m_NumOfColums * m_NumOfRows) / k_LettersInPair]; // the number of images need is the number of (rows * number of columns) / 2 InitializeComponents(); m_BoardGame = new BoardGameWindows(m_NumOfColums, m_NumOfRows); CreateBoard(); GameManager.StartGame(m_NumOfRows, m_NumOfColums, i_FirstPlayerName, i_SecondPlayerName, i_IsAgainstHuman); }