RemoveObjectInstance() public method

public RemoveObjectInstance ( FSO.SimAntics.VMEntity target ) : void
target FSO.SimAntics.VMEntity
return void
Ejemplo n.º 1
0
        public void Delete(bool cleanupAll,VMContext context)
        {
            if (cleanupAll)
            {
                MultitileGroup.Delete(context);
            }
            else
            {
                var threads = SoundThreads;

                for (int i = 0; i < threads.Count; i++)
                {
                    threads[i].Sound.RemoveOwner(ObjectID);
                }
                threads.Clear();

                PrePositionChange(context);
                context.RemoveObjectInstance(this);
                MultitileGroup.RemoveObject(this); //we're no longer part of the multitile group

                int slots = TotalSlots();
                for (int i = 0; i < slots; i++)
                {
                    var obj = GetSlot(i);
                    if (obj != null)
                    {
                        obj.SetPosition(Position,obj.Direction,context);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void Delete(bool cleanupAll, VMContext context)
        {
            if (cleanupAll) MultitileGroup.Delete(context);
            else
            {
                var threads = SoundThreads;

                for (int i = 0; i < threads.Count; i++)
                {
                    threads[i].Sound.RemoveOwner(ObjectID);
                }
                threads.Clear();

                PrePositionChange(context);
                context.RemoveObjectInstance(this);
                MultitileGroup.Objects.Remove(this); //we're no longer part of the multitile group

                int slots = TotalSlots();
                for (int i = 0; i < slots; i++)
                {
                    var obj = GetSlot(i);
                    if (obj != null)
                    {
                        obj.SetPosition(Position, obj.Direction, context);
                    }
                }

            }
        }