private void InitializeBoardManager(bool computerStarts) { if (m_BoardManager != null) { m_BoardManager.BoardChanged -= new EventHandler<BoardChangedEventArgs>(OnBoardChanged); m_BoardManager.GameOver -= new EventHandler<GameOverEventArgs>(OnGameOver); } m_BoardManager = new BoardManager(computerStarts); m_BoardManager.BoardChanged += new EventHandler<BoardChangedEventArgs>(OnBoardChanged); m_BoardManager.GameOver += new EventHandler<GameOverEventArgs>(OnGameOver); UpdateCellControls(); }
static void Main(string[] args) { try { BoardManager boardManager = new BoardManager(true); Board board = boardManager.Board; System.Console.WriteLine(board); boardManager.MakeMove(1, 1); System.Console.WriteLine(board); //board[0, 1] = CellState.Player2; //System.Console.WriteLine(board); } catch (Exception ex) { System.Console.WriteLine(ex.ToString()); } finally { System.Console.ReadLine(); } }