Exemple #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);
        }
Exemple #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;
        }
Exemple #3
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);
        }
Exemple #4
0
        /// <summary> Adds this Instance to the static Instance collection. </summary>
        public virtual void Create()
        {
            if (this.isCreated)
            {
                throw new ArgumentException("Instance is already in the collection!");
            }

            idColl.Add(this);

            instances.Add(this, ref this.collID, ref this.collTypeID);

            if (!this.IsStatic)
            {
                dynInstances.Add(this, ref this.dynID, ref this.dynTypeID);
            }

            this.isCreated = true;

            pAfterCreate();
        }
Exemple #5
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();
        }
Exemple #6
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);
        }
Exemple #7
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);
        }
Exemple #8
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);
        }