// Move to a location in a new container void MoveToLow(ContainerObject dst, IntVector3 dstLoc) { Debug.Assert(this.IsInitialized); Debug.Assert(!this.IsDestructed); Debug.Assert(this.Container != dst); var src = this.Container; var srcLoc = this.Location; this.OnParentChanging(); if (src != null) { src.RemoveChild(this); } this.Container = dst; this.Location = dstLoc; if (dst != null) { dst.AddChild(this); } this.OnParentChanged(src, dst); this.World.AddChange(new ObjectMoveChange(this, src, srcLoc, dst, dstLoc)); }
// Move to a location in a new container void MoveToLow(ContainerObject dst, IntVector3 dstLoc) { Debug.Assert(this.IsInitialized); Debug.Assert(!this.IsDestructed); Debug.Assert(this.Container != dst); var src = this.Container; var srcLoc = this.Location; this.OnParentChanging(); if (src != null) src.RemoveChild(this); this.Container = dst; this.Location = dstLoc; if (dst != null) dst.AddChild(this); this.OnParentChanged(src, dst); this.World.AddChange(new ObjectMoveChange(this, src, srcLoc, dst, dstLoc)); }