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

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

            if (!(_firingEntityID.Equals(rhs._firingEntityID)))
            {
                ivarsEqual = false;
            }
            if (!(_targetEntityID.Equals(rhs._targetEntityID)))
            {
                ivarsEqual = false;
            }

            return(ivarsEqual);
        }
コード例 #2
0
        /**
         * Compares for reference equality and value equality.
         */
        public bool equals(WarfareFamilyPdu rhs)
        {
            bool ivarsEqual = true;

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

            ivarsEqual = base.Equals(rhs);

            if( ! (_firingEntityID.Equals( rhs._firingEntityID) )) ivarsEqual = false;
            if( ! (_targetEntityID.Equals( rhs._targetEntityID) )) ivarsEqual = false;

            return ivarsEqual;
        }