Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        /// <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();
        }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
        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);
        }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
 public void AddDynVob(BaseVob vob)
 {
     dynVobs.Add(vob, ref vob.CellID);
 }
Ejemplo n.º 11
0
 public void AddClient(GameClient client)
 {
     clients.Add(client, ref client.cellID);
 }
Ejemplo n.º 12
0
 internal void AddClient(GameClient client)
 {
     clients.Add(client, ref client.dynID);
 }
Ejemplo n.º 13
0
 public void Add(T obj, ref int id, ref int typeID)
 {
     vobs.Add(obj, ref id);
     typeDict[(int)obj.VobType].Add(obj, ref typeID);
 }
Ejemplo n.º 14
0
 public void AddNPC(NPC npc)
 {
     npcs.Add(npc, ref npc.npcCellID);
 }