/// <summary> /// get: Retrieves from this gateslist the gate at the given index. /// set: Sets this gateslist at the given index to be `value`. /// </summary> /// <param name="idx">Index.</param> public Gate this[int idx] { get { return(Gates[idx]); } set { Gate indexGate = Gates[idx]; if (indexGate != value) { if (indexGate != null) { indexGate.OnDetached(); } Gates[idx] = value; if (value != null) { value.OnAttached(); } } } }
/// <summary> /// Removes the given gate from this gateslist. /// </summary> /// <param name="gate">Gate to remove.</param> public void Remove(Gate gate) { Gates.Remove(gate); gate.OnDetached(); }