/// <summary> Adds an AniJob to this Model. </summary> public void AddAniJob(AniJob job) { if (job == null) { throw new ArgumentNullException("AniJob is null!"); } if (job.IsCreated) { throw new ArgumentException("AniJob is already added to another Model!"); } if (job.NextAni != null && job.NextAni.ModelInstance != this) { throw new ArgumentException("AniJob's NextAni is for a different Model!"); } CanChangeNow(); aniIDs.Add(job); aniJobs.Add(job, ref job.collID); dynJobs.Add(job, ref job.dynID); pAddAniJob(job); job.SetModel(this); }
/// <summary> Adds this object to the static World collection. </summary> public void Create() { if (this.isCreated) { throw new ArgumentException("World is already in the collection!"); } worldsByID.Add(this); worlds.Add(this, ref this.collID); this.isCreated = true; }
public void Add() { DynamicCollection<char> collection = new DynamicCollection<char>(); Assert.AreEqual(collection.Length(), 10); for (int i = 0; i < 20; i++) { collection.Add((char)i); } Assert.AreEqual(collection.Length(), 20); }
public void Add() { DynamicCollection <char> collection = new DynamicCollection <char>(); Assert.AreEqual(collection.Length(), 10); for (int i = 0; i < 20; i++) { collection.Add((char)i); } Assert.AreEqual(collection.Length(), 20); }
internal void Create() { if (this.isCreated) { throw new Exception("Client is already in the collection!"); } idColl.Add(this); clients.Add(this, ref this.collID); this.isCreated = true; this.ScriptObject.OnConnection(); Messages.WriteDynamics(this); }
/// <summary> Adds this object to the static Model collection. </summary> public void Create() { if (this.isCreated) { throw new ArgumentException("Model is already in the collection!"); } idColl.Add(this); models.Add(this, ref this.collID); if (!this.IsStatic) { dynModels.Add(this, ref this.dynID); } this.isCreated = true; pAfterCreate(); }
public virtual void Add(Item item) { if (item == null) { throw new ArgumentNullException("Item is null!"); } else if (item.Container != null) { throw new ArgumentException("Item is already in a container!"); } else if (item.IsSpawned) { throw new ArgumentException("Item is spawned in the world!"); } idColl.Add(item); items.Add(item, ref item.collID); item.Container = this.Owner; pAfterAdd(item); }
public void AddOverlay(Overlay overlay) { if (overlay == null) { throw new ArgumentNullException("Overlay is null!"); } if (overlay.IsCreated) { throw new ArgumentException("Overlay is already added to another Model!"); } CanChangeNow(); ovIDs.Add(overlay); overlays.Add(overlay, ref overlay.collID); dynOvs.Add(overlay, ref overlay.dynID); pAddOverlay(overlay); overlay.SetModel(this); }
internal void AddVob(BaseVob vob) { if (vob == null) { throw new ArgumentNullException("Vob is null!"); } if (vob.IsSpawned) { throw new ArgumentException("Vob is already in a world!"); } if (vob.Instance == null) { throw new ArgumentException("Vob has no instance!"); } pBeforeAddVob(vob); vobsByID.Add(vob); // sets or checks the vob ID on the server vobs.Add(vob, ref vob.collID); pAfterAddVob(vob); }
public void AddDynVob(BaseVob vob) { dynVobs.Add(vob, ref vob.CellID); }
public void AddClient(GameClient client) { clients.Add(client, ref client.cellID); }
internal void AddClient(GameClient client) { clients.Add(client, ref client.dynID); }
public void Add(T obj, ref int id, ref int typeID) { vobs.Add(obj, ref id); typeDict[(int)obj.VobType].Add(obj, ref typeID); }
public void AddNPC(NPC npc) { npcs.Add(npc, ref npc.npcCellID); }