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

Method clusterSize

source/game/StarSystemWorld.cpp:183–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183float SystemWorld::clusterSize(CelestialCoordinate const& coordinate) const {
184 if (coordinate.isPlanetaryBody() && m_celestialDatabase->childOrbits(coordinate.parent()).contains(coordinate.orbitNumber())) {
185 auto childOrbits = m_celestialDatabase->childOrbits(coordinate).sorted();
186 if (childOrbits.size() > 0) {
187 CelestialCoordinate outer = coordinate.child(childOrbits.get(childOrbits.size() - 1));
188 return (planetOrbitDistance(outer) * 2) + planetSize(outer);
189 } else {
190 return planetSize(coordinate);
191 }
192 } else {
193 return planetSize(coordinate);
194 }
195};
196
197float SystemWorld::planetSize(CelestialCoordinate const& coordinate) const {
198 if (coordinate.isNull())

Callers 1

Calls 9

isPlanetaryBodyMethod · 0.80
childOrbitsMethod · 0.80
orbitNumberMethod · 0.80
childMethod · 0.80
containsMethod · 0.45
parentMethod · 0.45
sortedMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected