예제 #1
0
        /**
         * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
         */
        public bool equals(PointObjectStatePdu rhs)
        {
            bool ivarsEqual = true;

            if (rhs.GetType() != this.GetType())
            {
                return(false);
            }

            if (!(_objectID.Equals(rhs._objectID)))
            {
                ivarsEqual = false;
            }
            if (!(_referencedObjectID.Equals(rhs._referencedObjectID)))
            {
                ivarsEqual = false;
            }
            if (!(_updateNumber == rhs._updateNumber))
            {
                ivarsEqual = false;
            }
            if (!(_forceID == rhs._forceID))
            {
                ivarsEqual = false;
            }
            if (!(_modifications == rhs._modifications))
            {
                ivarsEqual = false;
            }
            if (!(_objectType.Equals(rhs._objectType)))
            {
                ivarsEqual = false;
            }
            if (!(_objectLocation.Equals(rhs._objectLocation)))
            {
                ivarsEqual = false;
            }
            if (!(_objectOrientation.Equals(rhs._objectOrientation)))
            {
                ivarsEqual = false;
            }
            if (!(_objectAppearance == rhs._objectAppearance))
            {
                ivarsEqual = false;
            }
            if (!(_requesterID.Equals(rhs._requesterID)))
            {
                ivarsEqual = false;
            }
            if (!(_receivingID.Equals(rhs._receivingID)))
            {
                ivarsEqual = false;
            }
            if (!(_pad2 == rhs._pad2))
            {
                ivarsEqual = false;
            }

            return(ivarsEqual);
        }
        /**
         * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
         */
        public bool equals(LinearObjectStatePdu rhs)
        {
            bool ivarsEqual = true;

            if (rhs.GetType() != this.GetType())
            {
                return(false);
            }

            if (!(_objectID.Equals(rhs._objectID)))
            {
                ivarsEqual = false;
            }
            if (!(_referencedObjectID.Equals(rhs._referencedObjectID)))
            {
                ivarsEqual = false;
            }
            if (!(_updateNumber == rhs._updateNumber))
            {
                ivarsEqual = false;
            }
            if (!(_forceID == rhs._forceID))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfSegments == rhs._numberOfSegments))
            {
                ivarsEqual = false;
            }
            if (!(_requesterID.Equals(rhs._requesterID)))
            {
                ivarsEqual = false;
            }
            if (!(_receivingID.Equals(rhs._receivingID)))
            {
                ivarsEqual = false;
            }
            if (!(_objectType.Equals(rhs._objectType)))
            {
                ivarsEqual = false;
            }

            for (int idx = 0; idx < _linearSegmentParameters.Count; idx++)
            {
                LinearSegmentParameter x = (LinearSegmentParameter)_linearSegmentParameters[idx];
                if (!(_linearSegmentParameters[idx].Equals(rhs._linearSegmentParameters[idx])))
                {
                    ivarsEqual = false;
                }
            }


            return(ivarsEqual);
        }