示例#1
0
        public override IEnumerable <Square> GetAvailableMoves(Board board)
        {
            AvailableMoves moves = new AvailableMoves(board.FindPiece(this));

            // create 2D array of move adjustments
            int[,] adjustments = new int[, ] {
                { 1, 1 }, { 1, 0 }, { 1, -1 }, { 0, 1 }, { 0, -1 }, { -1, 1 }, { -1, 0 }, { -1, -1 }
            };
            moves.AddAdjustedSquares(adjustments);

            return(moves.Squares);
        }