コード例 #1
0
		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();
		}
コード例 #2
0
		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();
			}
		}