Exemple #1
0
        /**
         * Compares for reference equality and value equality.
         */
        public bool equals(Marking rhs)
        {
            bool ivarsEqual = true;

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


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

            if (!(rhs._characters.Length == 11))
            {
                ivarsEqual = false;
            }
            if (ivarsEqual)
            {
                for (int idx = 0; idx < 11; idx++)
                {
                    if (!(_characters[idx] == rhs._characters[idx]))
                    {
                        ivarsEqual = false;
                    }
                }
            }


            return(ivarsEqual);
        }
 ///<summary>
 ///characters that can be used for debugging, or to draw unique strings on the side of entities in the world
 ///</summary>
 public void setMarking(Marking pMarking)
 {
     _marking = pMarking;
 }
 ///<summary>
 ///characters that can be used for debugging, or to draw unique strings on the side of entities in the world
 ///</summary>
 public void setMarking(Marking pMarking)
 {
     _marking = pMarking;
 }
        /**
          * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
          */
        public bool equals(Marking rhs)
        {
            bool ivarsEqual = true;

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

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

             for(int idx = 0; idx < 11; idx++)
             {
              if(!(_characters[idx] == rhs._characters[idx])) ivarsEqual = false;
             }

            return ivarsEqual;
        }