Exemplo n.º 1
0
        public override void ProcessDecay()
        {
            while (_decayQueue.Count > 0)
            {
                Item item = _decayQueue.Dequeue();

                if (item.OnDecay())
                {
                    item.Delete();
                }
            }

            while (_decayMapQueue.Count > 0)
            {
                BaseInstanceMap map = _decayMapQueue.Dequeue();

                if (map.OnDecay())
                {
                    map.Delete();
                }
            }
        }
Exemplo n.º 2
0
        private static void ProcessSafetyQueues()
        {
            while (_addQueue.Count > 0)
            {
                IEntity entity = _addQueue.Dequeue();

                Item item = entity as Item;

                if (item != null)
                {
                    AddItem(item);
                }
                else
                {
                    Mobile mob = entity as Mobile;

                    if (mob != null)
                    {
                        AddMobile(mob);
                    }
                }
            }

            while (_addMapQueue.Count > 0)
            {
                BaseInstanceMap map = _addMapQueue.Dequeue();

                if (map != null)
                {
                    AddMap(map);
                }
            }

            while (_deleteQueue.Count > 0)
            {
                IEntity entity = _deleteQueue.Dequeue();

                Item item = entity as Item;

                if (item != null)
                {
                    item.Delete();
                }
                else
                {
                    Mobile mob = entity as Mobile;

                    if (mob != null)
                    {
                        mob.Delete();
                    }
                }
            }

            while (_deleteMapQueue.Count > 0)
            {
                BaseInstanceMap map = _deleteMapQueue.Dequeue();

                if (map != null)
                {
                    map.Delete();
                }
            }
        }