Ejemplo n.º 1
0
        /// <summary>
        /// <see cref="Object.Equals(object)"/>
        /// </summary>
        public override bool Equals(object obj)
        {
            AtomicUnit U = obj as AtomicUnit;

            if (U == null)
            {
                return(false);
            }
            else
            {
                return(this.name.Equals(U.name));
            }
        }
Ejemplo n.º 2
0
        private void Add(LinkedList <KeyValuePair <AtomicUnit, int> > Factors, AtomicUnit AtomicUnit, int Exponent)
        {
            LinkedListNode <KeyValuePair <AtomicUnit, int> > Loop = Factors.First;
            string Name = AtomicUnit.Name;

            while (!(Loop is null) && Loop.Value.Key.Name != Name)
            {
                Loop = Loop.Next;
            }

            if (Loop is null)
            {
                Factors.AddLast(new KeyValuePair <AtomicUnit, int>(AtomicUnit, Exponent));
            }
            else
            {
                Loop.Value = new KeyValuePair <AtomicUnit, int>(AtomicUnit, Loop.Value.Value + Exponent);
            }
        }