| 292 | } |
| 293 | |
| 294 | List<CelestialCoordinate> CelestialMasterDatabase::scanSystems(RectI const& region, Maybe<StringSet> const& includedTypes) { |
| 295 | RecursiveMutexLocker locker(m_mutex); |
| 296 | |
| 297 | List<CelestialCoordinate> systems; |
| 298 | for (auto const& chunkLocation : chunkIndexesFor(region)) { |
| 299 | auto const& chunkData = getChunk(chunkLocation, [&](std::function<void()>&& func) { |
| 300 | locker.unlock(); |
| 301 | func(); |
| 302 | locker.lock(); |
| 303 | }); |
| 304 | locker.unlock(); |
| 305 | for (auto const& pair : chunkData.systemParameters) { |
| 306 | Vec3I systemLocation = pair.first; |
| 307 | if (region.contains(systemLocation.vec2())) { |
| 308 | if (includedTypes) { |
| 309 | String thisType = pair.second.getParameter("typeName", "").toString(); |
| 310 | if (!includedTypes->contains(thisType)) |
| 311 | continue; |
| 312 | } |
| 313 | systems.append(CelestialCoordinate(systemLocation)); |
| 314 | } |
| 315 | } |
| 316 | locker.lock(); |
| 317 | } |
| 318 | return systems; |
| 319 | } |
| 320 | |
| 321 | List<pair<Vec2I, Vec2I>> CelestialMasterDatabase::scanConstellationLines(RectI const& region) { |
| 322 | RecursiveMutexLocker locker(m_mutex); |
no test coverage detected