| 231 | } |
| 232 | |
| 233 | Maybe<CelestialParameters> CelestialMasterDatabase::parameters(CelestialCoordinate const& coordinate) { |
| 234 | RecursiveMutexLocker locker(m_mutex); |
| 235 | |
| 236 | if (!coordinateValid(coordinate)) |
| 237 | throw CelestialException("CelestialMasterDatabase::parameters called on invalid coordinate"); |
| 238 | |
| 239 | auto const& chunk = getChunk(chunkIndexFor(coordinate)); |
| 240 | |
| 241 | if (coordinate.isSatelliteBody()) |
| 242 | return chunk.systemObjects.get(coordinate.location()) |
| 243 | .get(coordinate.parent().orbitNumber()) |
| 244 | .satelliteParameters.get(coordinate.orbitNumber()); |
| 245 | |
| 246 | if (coordinate.isPlanetaryBody()) |
| 247 | return chunk.systemObjects.get(coordinate.location()).get(coordinate.orbitNumber()).planetParameters; |
| 248 | |
| 249 | return chunk.systemParameters.get(coordinate.location()); |
| 250 | } |
| 251 | |
| 252 | Maybe<String> CelestialMasterDatabase::name(CelestialCoordinate const& coordinate) { |
| 253 | return parameters(coordinate)->name(); |
nothing calls this directly
no test coverage detected