MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / parameters

Method parameters

source/game/StarCelestialDatabase.cpp:233–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233Maybe<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
252Maybe<String> CelestialMasterDatabase::name(CelestialCoordinate const& coordinate) {
253 return parameters(coordinate)->name();

Callers

nothing calls this directly

Calls 11

isSatelliteBodyMethod · 0.80
orbitNumberMethod · 0.80
isPlanetaryBodyMethod · 0.80
isSystemMethod · 0.80
vec2Method · 0.80
planetMethod · 0.80
getMethod · 0.45
locationMethod · 0.45
parentMethod · 0.45
ptrMethod · 0.45
maybeMethod · 0.45

Tested by

no test coverage detected