Descent.Model.Board.Board.CanFigureMoveToPoint C# (CSharp) Method

CanFigureMoveToPoint() public method

Gets a value indicating whether a figure can move to a point
public CanFigureMoveToPoint ( Figure figure, Point point ) : bool
figure Descent.Model.Player.Figure.Figure /// The figure ///
point Point /// The upper left corner of the end point ///
return bool
        public bool CanFigureMoveToPoint(Figure figure, Point point)
        {
            Contract.Requires(figure != null);
            if (figure.Size.Width == 1 && figure.Size.Height == 1) return IsStandable(point.X, point.Y);

            bool canMove = true;

            List<Point> list = new List<Point>();
            for (int x = point.X;
                 x < point.X + (figure.Orientation.Equals(Orientation.V) ? figure.Size.Width : figure.Size.Height);
                 x++)
            {
                for (int y = point.Y;
                     y < point.Y + (figure.Orientation.Equals(Orientation.V) ? figure.Size.Height : figure.Size.Width);
                     y++)
                {
                    canMove &= IsStandable(x, y) || (IsSquareWithinBoard(x, y) && this[x, y].Figure == figure);
                }
            }

            return canMove;
        }