Exemple #1
0
        public bool CheckConstraints(Vertex endVertex)
        {
            if (NextConstraint == SideConstraint.Vertical)
            {
                if (X != Next.X)
                {
                    return(false);
                }
            }
            if (NextConstraint == SideConstraint.Horizontal)
            {
                if (Y != Next.Y)
                {
                    return(false);
                }
            }
            if (Constraint == VertexConstraint.Angle)
            {
                if (Math.Abs(aPrev - aPrevConstraint) > Constants.Eps || Math.Abs(aNext - aNextConstraint) > Constants.Eps)
                {
                    return(false);
                }
            }

            if (this == endVertex)
            {
                return(true);
            }

            return(Next.CheckConstraints(endVertex));
        }