Пример #1
0
        /**
         * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
         */
        public bool equals(AggregateStatePdu rhs)
        {
            bool ivarsEqual = true;

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

            if (!(_aggregateID.Equals(rhs._aggregateID)))
            {
                ivarsEqual = false;
            }
            if (!(_forceID == rhs._forceID))
            {
                ivarsEqual = false;
            }
            if (!(_aggregateState == rhs._aggregateState))
            {
                ivarsEqual = false;
            }
            if (!(_aggregateType.Equals(rhs._aggregateType)))
            {
                ivarsEqual = false;
            }
            if (!(_formation == rhs._formation))
            {
                ivarsEqual = false;
            }
            if (!(_aggregateMarking.Equals(rhs._aggregateMarking)))
            {
                ivarsEqual = false;
            }
            if (!(_dimensions.Equals(rhs._dimensions)))
            {
                ivarsEqual = false;
            }
            if (!(_orientation.Equals(rhs._orientation)))
            {
                ivarsEqual = false;
            }
            if (!(_centerOfMass.Equals(rhs._centerOfMass)))
            {
                ivarsEqual = false;
            }
            if (!(_velocity.Equals(rhs._velocity)))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfDisAggregates == rhs._numberOfDisAggregates))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfDisEntities == rhs._numberOfDisEntities))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfSilentAggregateTypes == rhs._numberOfSilentAggregateTypes))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfSilentEntityTypes == rhs._numberOfSilentEntityTypes))
            {
                ivarsEqual = false;
            }

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


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

            if (!(_pad2 == rhs._pad2))
            {
                ivarsEqual = false;
            }

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


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

            if (!(_numberOfVariableDatumRecords == rhs._numberOfVariableDatumRecords))
            {
                ivarsEqual = false;
            }

            for (int idx = 0; idx < _variableDatumList.Count; idx++)
            {
                VariableDatum x = (VariableDatum)_variableDatumList[idx];
                if (!(_variableDatumList[idx].Equals(rhs._variableDatumList[idx])))
                {
                    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(AggregateStatePdu rhs)
        {
            bool ivarsEqual = true;

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

             if( ! (_aggregateID.Equals( rhs._aggregateID) )) ivarsEqual = false;
             if( ! (_forceID == rhs._forceID)) ivarsEqual = false;
             if( ! (_aggregateState == rhs._aggregateState)) ivarsEqual = false;
             if( ! (_aggregateType.Equals( rhs._aggregateType) )) ivarsEqual = false;
             if( ! (_formation == rhs._formation)) ivarsEqual = false;
             if( ! (_aggregateMarking.Equals( rhs._aggregateMarking) )) ivarsEqual = false;
             if( ! (_dimensions.Equals( rhs._dimensions) )) ivarsEqual = false;
             if( ! (_orientation.Equals( rhs._orientation) )) ivarsEqual = false;
             if( ! (_centerOfMass.Equals( rhs._centerOfMass) )) ivarsEqual = false;
             if( ! (_velocity.Equals( rhs._velocity) )) ivarsEqual = false;
             if( ! (_numberOfDisAggregates == rhs._numberOfDisAggregates)) ivarsEqual = false;
             if( ! (_numberOfDisEntities == rhs._numberOfDisEntities)) ivarsEqual = false;
             if( ! (_numberOfSilentAggregateTypes == rhs._numberOfSilentAggregateTypes)) ivarsEqual = false;
             if( ! (_numberOfSilentEntityTypes == rhs._numberOfSilentEntityTypes)) ivarsEqual = false;

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

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

             if( ! (_pad2 == rhs._pad2)) ivarsEqual = false;

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

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

             if( ! (_numberOfVariableDatumRecords == rhs._numberOfVariableDatumRecords)) ivarsEqual = false;

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

            return ivarsEqual;
        }