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

Method systemLocationPosition

source/game/StarSystemWorld.cpp:278–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278Maybe<Vec2F> SystemWorld::systemLocationPosition(SystemLocation const& location) const {
279 if (auto coordinate = location.maybe<CelestialCoordinate>()) {
280 return planetPosition(*coordinate);
281 } else if (auto orbit = location.maybe<CelestialOrbit>()) {
282 return orbitPosition(*orbit);
283 } else if (auto objectUuid = location.maybe<Uuid>()) {
284 if (auto object = getObject(*objectUuid))
285 return object->position();
286 } else if (auto position = location.maybe<Vec2F>()) {
287 return Vec2F(*position);
288 }
289 return {};
290}
291
292Vec2F SystemWorld::randomArrivalPosition() const {
293 RandomSource rand;

Callers 3

SystemClientShipMethod · 0.80
serverUpdateMethod · 0.80

Calls 1

positionMethod · 0.45

Tested by

no test coverage detected