Пример #1
0
        /// <summary>
        /// Comparing two splines
        /// </summary>
        /// <param name="o"></param>
        /// <returns></returns>
        public override bool Equals(object o)
        {
            Spline other = (Spline)o;

            if (Length != other.Length)
            {
                return(false);
            }

            for (int i = 0; i < Length; i++)
            {
                if (waypoints[i].localPosition != other.waypoints[i].localPosition)
                {
                    return(false);
                }
                if (GetHandlesLength(i) != other.GetHandlesLength(i))
                {
                    return(false);
                }
                if (waypoints[i].localHandles.Length != other.waypoints[i].localHandles.Length)
                {
                    return(false);
                }
                if (GetSubwaysLength(i) != other.GetSubwaysLength(i))
                {
                    return(false);
                }
                if (GetReversewaysLength(i) != other.GetReversewaysLength(i))
                {
                    return(false);
                }
                if (resolution != other.resolution)
                {
                    return(false);
                }
                if (waypoints[i].method != other[i].method)
                {
                    return(false);
                }
                for (int c = 0; c < waypoints[i].localHandles.Length; c++)
                {
                    if (waypoints[i].localHandles[c] != other.waypoints[i].localHandles[c])
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }