void NotifyTileObjectChanges(IntGrid3 oldGrid, IntGrid3 newGrid) { if (m_environment == null) { m_objects.Clear(); return; } var rm = oldGrid.Range().Except(newGrid.Range()) .SelectMany(p => m_environment.GetContents(p)); foreach (var ob in rm) { m_objects.Remove(ob); } var add = newGrid.Range().Except(oldGrid.Range()) .SelectMany(p => m_environment.GetContents(p)); foreach (var ob in add) { m_objects.Add(ob); } }
/// <summary> /// Internal method for telling the node that a movable no longer intersects it. /// </summary> public void RemoveObject(MovableObject obj) { objectList.Remove(obj); }
public void RemoveChild(MovableObject ob) { m_contents.Remove(ob); ChildRemoved(ob); }