| 297 | } |
| 298 | |
| 299 | Maybe<WarpAction> SystemWorld::objectWarpAction(Uuid const& uuid) const { |
| 300 | if (auto object = getObject(uuid)) { |
| 301 | WarpAction warpAction = object->warpAction(); |
| 302 | if (auto warpToWorld = warpAction.ptr<WarpToWorld>()) { |
| 303 | if (auto instanceWorldId = warpToWorld->world.ptr<InstanceWorldId>()) { |
| 304 | instanceWorldId->uuid = object->uuid(); |
| 305 | if (auto parameters = m_celestialDatabase->parameters(CelestialCoordinate(m_location))) { |
| 306 | Maybe<float> systemThreatLevel = parameters->getParameter("spaceThreatLevel").optFloat(); |
| 307 | instanceWorldId->level = object->threatLevel().orMaybe(systemThreatLevel); |
| 308 | } else { |
| 309 | return {}; |
| 310 | } |
| 311 | } |
| 312 | } |
| 313 | return warpAction; |
| 314 | } else { |
| 315 | return {}; |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | SystemObject::SystemObject(SystemObjectConfig config, Uuid uuid, Vec2F const& position, JsonObject parameters) |
| 320 | : m_config(std::move(config)), m_uuid(std::move(uuid)), m_spawnTime(0.0f), m_parameters(std::move(parameters)) { |
no test coverage detected