예제 #1
0
        private void CopyEntity(TR2Entity entity, TR2Entities newType)
        {
            List <TR2Entity> ents = _levelInstance.Data.Entities.ToList();

            if (ents.Count < _levelInstance.GetMaximumEntityLimit())
            {
                TR2Entity copy = entity.Clone();
                copy.TypeID = (short)newType;
                ents.Add(copy);
                _levelInstance.Data.NumEntities++;
                _levelInstance.Data.Entities = ents.ToArray();
            }
        }
예제 #2
0
        private void AddORAmmo(TR2Entities ammoType, uint count, TR2Entity weapon)
        {
            List <TR2Entity> ents = _levelInstance.Entities.ToList();

            for (uint i = 0; i < count; i++)
            {
                TR2Entity ammo = weapon.Clone();

                ammo.TypeID = (short)ammoType;

                ents.Add(ammo);
            }
            ;

            _levelInstance.NumEntities += count;
            _levelInstance.Entities     = ents.ToArray();
        }
예제 #3
0
        private void AddORAmmo(TR2Entities ammoType, uint count, TR2Entity weapon)
        {
            List <TR2Entity> ents = _levelInstance.Data.Entities.ToList();

            int entityLimit = _levelInstance.GetMaximumEntityLimit();

            for (uint i = 0; i < count && ents.Count < entityLimit; i++)
            {
                TR2Entity ammo = weapon.Clone();

                ammo.TypeID = (short)ammoType;

                ents.Add(ammo);
            }
            ;

            _levelInstance.Data.NumEntities = (uint)ents.Count;
            _levelInstance.Data.Entities    = ents.ToArray();
        }