/// <summary> /// Raising the current player score and call the event CoupleFound. /// If there is no couple to reveal, this method call the event GameOver. /// </summary> /// <param name="i_current">The current cell cordinates were revealed.</param> private void areMatching(Point i_current) { m_Board[i_current.X, i_current.Y].m_IsRevealed = true; m_Board[m_LastRevealed.X, m_LastRevealed.Y].m_IsRevealed = true; Players[m_CurrentPlayerIndex].IncreaseScore(); if (CoupleFound != null) { CoupleFound.Invoke(m_LastRevealed, i_current); } if (!IsThereHidden()) { GameOver.Invoke(); } else { OneTurnEnded.Invoke(); letComputerPlayerPlay(); } }
/// <summary> /// Update the turn to the next player turn. /// </summary> public void UpdateTurn() { m_CurrentPlayerIndex = (m_CurrentPlayerIndex + 1) % Players.Length; OneTurnEnded.Invoke(); letComputerPlayerPlay(); }