public void RemoveAll(RemoveAllHandler removeAllHandlerCallback) { if (this.BottomLeftBack != null) { removeAllHandlerCallback(ref this.BottomLeftBack); BottomLeftBack.RemoveAll(removeAllHandlerCallback); this.BottomLeftBack = null; } if (this.BottomLeftFront != null) { removeAllHandlerCallback(ref this.BottomLeftFront); BottomLeftFront.RemoveAll(removeAllHandlerCallback); this.BottomLeftFront = null; } if (this.BottomRightBack != null) { removeAllHandlerCallback(ref this.BottomRightBack); BottomRightBack.RemoveAll(removeAllHandlerCallback); this.BottomRightBack = null; } if (this.BottomRightFront != null) { removeAllHandlerCallback(ref this.BottomRightFront); BottomRightFront.RemoveAll(removeAllHandlerCallback); this.BottomRightFront = null; } if (this.TopLeftBack != null) { removeAllHandlerCallback(ref this.TopLeftBack); TopLeftBack.RemoveAll(removeAllHandlerCallback); this.TopLeftBack = null; } if (this.TopLeftFront != null) { removeAllHandlerCallback(ref this.TopLeftFront); TopLeftFront.RemoveAll(removeAllHandlerCallback); this.TopLeftFront = null; } if (this.TopRightBack != null) { removeAllHandlerCallback(ref this.TopRightBack); TopRightBack.RemoveAll(removeAllHandlerCallback); this.TopRightBack = null; } if (this.TopRightFront != null) { removeAllHandlerCallback(ref this.TopRightFront); TopRightFront.RemoveAll(removeAllHandlerCallback); this.TopRightFront = null; } }
public Octree(T space, AddHandler addHandler, RemoveHandler removeHandler, SearchHandler searchHandler, SetRootHandler setRootHandler, RemoveAllHandler removeAllHandler) { this.space = space; this.AddHandlerCallback = addHandler; this.RemoveHandlerCallback = removeHandler; this.SearchHandlerCallback = searchHandler; this.SetRootHandlerCallback = setRootHandler; this.RemoveAllHandlerCallback = removeAllHandler; }