/// <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); }
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); }
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); }
/// <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); } }
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(); }
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); }
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); }
public void RemoveDynVob(BaseVob vob) { dynVobs.Remove(ref vob.CellID); }
public void RemoveClient(GameClient client) { clients.Remove(ref client.cellID); }
internal void RemoveClient(GameClient client) { clients.Remove(ref client.dynID); }
public void Remove(T obj, ref int id, ref int typeID) { vobs.Remove(ref id); typeDict[(int)obj.VobType].Remove(ref typeID); }
public void RemoveNPC(NPC npc) { npcs.Remove(ref npc.npcCellID); }