Exemple #1
0
        public Slot(Slot another)
        {
            if (another.Data != null)
            {
                data = another.Data;
            }

            individual = new ArrayList();
            if (another.Individual != null)
            {
                string[] items = (string[])another.Individual.Clone();
                individual.Clear();
                foreach (string item in items)
                {
                    individual.Add(new string(item.ToCharArray()));
                }
            }
        }
Exemple #2
0
        public override bool Equals(object o)
        {
            if (o == null || GetType() != o.GetType())
            {
                return false;
            }

            Slot other = new Slot((Slot)o);

            if (this.Data != null)
            {
                if (!this.Data.Equals(other.Data))
                {
                    return false;
                }
            }

            if (Individual.Length != other.Individual.Length)
            {
                return false;
            }

            for (int i = 0; i < Individual.Length; i++)
            {
                if (!Individual[i].Equals(other.Individual[i]))
                {
                    return false;
                }
            }

            return true;
        }
Exemple #3
0
 public int AddSlot(Slot item)
 {
     return slot.Add(item);
 }