Ejemplo n.º 1
0
        /// <summary>
        /// Removes all actors from a region tree
        /// </summary>
        public void RefreshActors()
        {
            WaitCallback callback = delegate(object state)
            {
                foreach (KeyValuePair <uint, Zone> pair in this.maps)
                {
                    Regiontree tree = pair.Value.Regiontree;
                    foreach (MapObject regionObject in tree.SearchActors(SearchFlags.Npcs))
                    {
                        BaseNPC npc = regionObject as BaseNPC;
                        if (npc != null)
                        {
                            npc.OnRefresh();
                        }
                    }
                }
            };

            ThreadPool.QueueUserWorkItem(callback);
        }