public bool Update(T item) { if (ArrayEx.Contains(m_items, m_items_size, item)) { if (Bound.Contains(item.Position)) { return(true); } return(ArrayEx.Remove(m_items, ref m_items_size, item) && (Parent?.Add(item) ?? false)); } return(Add(item)); }
public bool Contains(T item) { if (Bound.Contains(item.Position)) { if (m_childs.Length == 0) { return(ArrayEx.Contains(m_items, m_items_size, item)); } for (int index = 0; index < m_childs.Length; index++) { if (m_childs[index].Contains(item)) { return(true); } } } return(Parent?.Contains(item) ?? false); }