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())); } } }
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; }
public int AddSlot(Slot item) { return slot.Add(item); }