Example #1
0
        /// <summary> Removes this object from the static World collection. </summary>
        public void Delete()
        {
            if (!this.isCreated)
            {
                throw new ArgumentException("World is not in the collection!");
            }

            pBeforeDelete();

            this.isCreated = false;

            worldsByID.Remove(this);
            worlds.Remove(ref this.collID);
        }
Example #2
0
        public virtual void Remove(Item item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("Item is null!");
            }
            else if (item.Container != this.Owner)
            {
                throw new ArgumentException("Item is in a different container!");
            }

            item.Container = null;
            idColl.Remove(item);
            items.Remove(ref item.collID);

            pAfterRemove(item);
        }
Example #3
0
        internal void RemoveVob(BaseVob vob)
        {
            if (vob == null)
            {
                throw new ArgumentNullException("Vob is null!");
            }

            if (vob.World != this)
            {
                throw new ArgumentException("Vob is not in this world!");
            }

            pBeforeRemoveVob(vob);

            vobsByID.Remove(vob); // sets the vob ID to -1 on the server!!!
            vobs.Remove(ref vob.collID);

            pAfterRemoveVob(vob);
        }
Example #4
0
        /// <summary> Removes this object from the static Model collection. </summary>
        public void Delete()
        {
            if (!this.isCreated)
            {
                throw new ArgumentException("Model is not in the collection!");
            }

            pBeforeDelete();

            this.isCreated = false;

            idColl.Remove(this);
            models.Remove(ref this.collID);

            if (!this.IsStatic)
            {
                dynModels.Remove(ref this.dynID);
            }
        }
Example #5
0
        internal void Delete()
        {
            if (!this.isCreated)
            {
                throw new Exception("Client is not in the collection!");
            }

            if (this.character != null)
            {
                if (this.character.IsSpawned && !loading)
                {
                    this.character.World.RemoveClient(this);
                    this.Character.Cell.RemoveClient(this);
                }
                this.character.client = null;
            }
            else if (this.isSpectating)
            {
                if (!loading) // still loading
                {
                    this.specWorld.RemoveClient(this);
                    this.specWorld.RemoveSpectatorFromCells(this);
                }
                this.specWorld = null;
            }

            visibleVobs.ForEach(vob => vob.RemoveVisibleClient(this));
            visibleVobs.Clear();

            this.isCreated = false;

            int id = this.ID; // preserve the id

            idColl.Remove(this);
            clients.Remove(ref this.collID);

            this.ScriptObject.OnDisconnection(id);

            this.character = null;

            this.systemAddress.Dispose();
            this.guid.Dispose();
        }
Example #6
0
        public void RemoveOverlay(Overlay overlay)
        {
            if (overlay == null)
            {
                throw new ArgumentNullException("Overlay is null!");
            }

            if (overlay.Model != this)
            {
                throw new Exception("Overlay is not from this Model!");
            }

            CanChangeNow();

            overlay.SetModel(null);

            ovIDs.Remove(overlay);
            overlays.Remove(ref overlay.collID);
            dynOvs.Remove(ref overlay.dynID);

            pRemoveOverlay(overlay);
        }
Example #7
0
        public void RemoveAniJob(AniJob job)
        {
            if (job == null)
            {
                throw new ArgumentNullException("AniJob is null!");
            }

            if (job.ModelInstance != this)
            {
                throw new Exception("AniJob is not from this Model!");
            }

            CanChangeNow();

            job.SetModel(null);

            aniIDs.Remove(job);
            aniJobs.Remove(ref job.collID);
            dynJobs.Remove(ref job.dynID);

            pRemoveAniJob(job);
        }
Example #8
0
 public void RemoveDynVob(BaseVob vob)
 {
     dynVobs.Remove(ref vob.CellID);
 }
Example #9
0
 public void RemoveClient(GameClient client)
 {
     clients.Remove(ref client.cellID);
 }
Example #10
0
 internal void RemoveClient(GameClient client)
 {
     clients.Remove(ref client.dynID);
 }
Example #11
0
 public void Remove(T obj, ref int id, ref int typeID)
 {
     vobs.Remove(ref id);
     typeDict[(int)obj.VobType].Remove(ref typeID);
 }
Example #12
0
 public void RemoveNPC(NPC npc)
 {
     npcs.Remove(ref npc.npcCellID);
 }