Пример #1
0
 public GoBoardForm(Board board)
 {
     _board = board;
     InitializeComponent();
 }
Пример #2
0
 public Rules(Board board)
 {
     Board = board;
 }
Пример #3
0
        private void FillBoard(Board board, string stoneMap)
        {
            stoneMap = stoneMap.Trim();
             var lines = stoneMap.Split('\n');
            for (int i = 1; i < lines.Length; i++)
            {
                string line = lines[i].Trim();
                for (int j = 1; j < line.Length; j++)
                {
                    char cell = line[j];
                    if(cell != ' ')
                    {
                        StoneColor color = StoneColor.Black;

                        if(cell == 'W')
                        {
                            color = StoneColor.White;
                        }

                        board.AddStone(color, j, i);
                    }
                }
            }
        }