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); } } } }
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); } } } }