/// <summary> /// Use this to remove children m_aggregate, usually you want to remove only AreaInventoryAggregate from dead character /// </summary> /// <param name="child">some child m_aggregate implementation</param> virtual public void RemoveChild(IMyInventoryAggregate child) { child.ContentsChanged -= OnContentsChanged; child.OwnerChanged -= OnOwnerChanged; m_children.Remove(child); }
/// <summary> /// Use this to add children aggregates - basically on character should be only two, CharacterInventoryAggregate and AreInventoryAggregate /// </summary> /// <param name="child">some child m_aggregate</param> virtual public void AddChild(IMyInventoryAggregate child) { Debug.Assert(child != this, "Cannot add itself!"); m_children.Add(child); child.OwnerChanged += OnOwnerChanged; child.ContentsChanged += OnContentsChanged; }