예제 #1
0
        public BoardController(int width, int height)
        {
            if (width != 8 || height != 8)
            {
                throw new ArgumentException("A chess board is 8x8 fields.");
            }

            Board = new Board(width, height);

            for (int x = 0; x < width; x++)
            {
                for (int y = 0; y < height; y++)
                {
                    var fc = new FieldController(x, y);
                    FieldControllers[x, y] = fc;
                    Board.Fields[x, y]     = fc.Field;
                }
            }
        }