AddChild() приватный Метод

private AddChild ( MovableObject ob ) : void
ob MovableObject
Результат void
Пример #1
0
        // 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));
        }
Пример #2
0
        // 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));
        }