示例#1
0
 public void DoForAllMaps(Action <Map> worker)
 {
     lock (_mapsLock)
     {
         foreach (var map in i_maps.Values)
         {
             MapInstanced mapInstanced = map.ToMapInstanced();
             if (mapInstanced)
             {
                 var instances = mapInstanced.GetInstancedMaps();
                 foreach (var instance in instances.Values)
                 {
                     worker(instance);
                 }
             }
             else
             {
                 worker(map);
             }
         }
     }
 }
示例#2
0
 public void DoForAllMapsWithMapId(uint mapId, Action <Map> worker)
 {
     lock (_mapsLock)
     {
         var map = i_maps.LookupByKey(mapId);
         if (map != null)
         {
             MapInstanced mapInstanced = map.ToMapInstanced();
             if (mapInstanced)
             {
                 var instances = mapInstanced.GetInstancedMaps();
                 foreach (var instance in instances)
                 {
                     worker(instance.Value);
                 }
             }
             else
             {
                 worker(map);
             }
         }
     }
 }