AddChild() private method

private AddChild ( MovableObject ob ) : void
ob MovableObject
return 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
ファイル: MovableObject.cs プロジェクト: tomba/dwarrowdelf
        // 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));
        }