예제 #1
0
        /// <summary>
        /// Indicates whether the current object is equal to another object of the same
        /// type. The comparison is based on EntityIdentifier.
        ///
        /// If the local EntityIdentifier is empty, then return false.
        /// </summary>
        /// <param name="other">An object to compare with this object</param>
        /// <returns></returns>
        public bool IsEquatable(IIdentifiable other)
        {
            if (EntityIdentifier == default(Guid))
            {
                return(false);
            }

            return(EntityIdentifier.Equals(other.EntityIdentifier));
        }
예제 #2
0
 /// <summary>
 /// Compares internal data for equality.
 /// </summary>
 /// <param name="b"></param>
 /// <returns></returns>
 public bool Equals(EntityState b)
 {
     if (!Header.Equals(this, b))
     {
         return(false);
     }
     if (!entityID.Equals(b.entityID))
     {
         return(false);
     }
     if (forceID != b.forceID)
     {
         return(false);
     }
     if (!entityType.Equals(b.entityType))
     {
         return(false);
     }
     if (!alternateEntityType.Equals(b.alternateEntityType))
     {
         return(false);
     }
     if (!linearVelocity.Equals(b.linearVelocity))
     {
         return(false);
     }
     if (!location.Equals(b.location))
     {
         return(false);
     }
     if (!orientation.Equals(b.orientation))
     {
         return(false);
     }
     if (!appearance.Equals(b.appearance))
     {
         return(false);
     }
     if (!deadReckoningParameter.Equals(b.deadReckoningParameter))
     {
         return(false);
     }
     if (!marking.Equals(b.marking))
     {
         return(false);
     }
     if (!capabilities.Equals(b.capabilities))
     {
         return(false);
     }
     if (!variableParameters.Equals(b.variableParameters))
     {
         return(false);
     }
     return(true);
 }
예제 #3
0
        /// <summary>
        /// Indicates whether the current object is equal to another object of the same
        /// type. The comparison is based on EntityIdentifier.
        ///
        /// If the local EntityIdentifier is empty, then return false.
        /// </summary>
        /// <param name="other">An object to compare with this object</param>
        /// <returns></returns>
        public bool IsEquatable(IIdentifiable other)
        {
            if (EntityIdentifier == default(Guid))
            {
                return(false);
            }

            var otherEntity = other as EntityBase;

            if (otherEntity == null)
            {
                return(false);
            }

            return(EntityIdentifier.Equals(otherEntity.EntityIdentifier));
        }
예제 #4
0
 /// <summary>
 /// Compares internal data for equality.
 /// </summary>
 /// <param name="b"></param>
 /// <returns></returns>
 public bool Equals(Collision b)
 {
     if (!Header.Equals(this, b))
     {
         return(false);
     }
     if (!issuingEntityID.Equals(b.issuingEntityID))
     {
         return(false);
     }
     if (!collidingEntityID.Equals(b.collidingEntityID))
     {
         return(false);
     }
     if (!eventID.Equals(b.eventID))
     {
         return(false);
     }
     if (collisionType != b.collisionType)
     {
         return(false);
     }
     if (!velocity.Equals(b.velocity))
     {
         return(false);
     }
     if (mass != b.mass)
     {
         return(false);
     }
     if (!location.Equals(b.location))
     {
         return(false);
     }
     return(true);
 }
예제 #5
0
 /// <summary>
 /// Compares internal data for equality.
 /// </summary>
 /// <param name="b"></param>
 /// <returns></returns>
 public bool Equals(WarfareHeader b)
 {
     if (!Header.Equals(this, b))
     {
         return(false);
     }
     if (!firingEntityID.Equals(b.firingEntityID))
     {
         return(false);
     }
     if (!targetEntityID.Equals(b.targetEntityID))
     {
         return(false);
     }
     if (!munitionID.Equals(b.munitionID))
     {
         return(false);
     }
     if (!eventID.Equals(b.eventID))
     {
         return(false);
     }
     return(true);
 }