using System; using Dalamud.Plugin; using Dalamud.Plugin.Ipc; using Microsoft.Extensions.Logging; using Questionable.Model.Common; namespace Questionable.External; internal sealed class LifestreamIpc { private readonly ILogger _logger; private readonly ICallGateSubscriber _aethernetTeleportByPlaceNameId; private readonly ICallGateSubscriber _aethernetTeleportById; private readonly ICallGateSubscriber _aethernetTeleportToFirmament; public LifestreamIpc(IDalamudPluginInterface pluginInterface, ILogger logger) { _logger = logger; _aethernetTeleportByPlaceNameId = pluginInterface.GetIpcSubscriber("Lifestream.AethernetTeleportByPlaceNameId"); _aethernetTeleportById = pluginInterface.GetIpcSubscriber("Lifestream.AethernetTeleportById"); _aethernetTeleportToFirmament = pluginInterface.GetIpcSubscriber("Lifestream.AethernetTeleportToFirmament"); } public bool Teleport(EAetheryteLocation aetheryteLocation) { _logger.LogInformation("Teleporting to '{Name}'", aetheryteLocation); return aetheryteLocation switch { EAetheryteLocation.IshgardFirmament => _aethernetTeleportToFirmament.InvokeFunc(), EAetheryteLocation.FirmamentMendicantsCourt => _aethernetTeleportByPlaceNameId.InvokeFunc(3436u), EAetheryteLocation.FirmamentMattock => _aethernetTeleportByPlaceNameId.InvokeFunc(3473u), EAetheryteLocation.FirmamentNewNest => _aethernetTeleportByPlaceNameId.InvokeFunc(3475u), EAetheryteLocation.FirmanentSaintRoellesDais => _aethernetTeleportByPlaceNameId.InvokeFunc(3474u), EAetheryteLocation.FirmamentFeatherfall => _aethernetTeleportByPlaceNameId.InvokeFunc(3525u), EAetheryteLocation.FirmamentHoarfrostHall => _aethernetTeleportByPlaceNameId.InvokeFunc(3528u), EAetheryteLocation.FirmamentWesternRisensongQuarter => _aethernetTeleportByPlaceNameId.InvokeFunc(3646u), EAetheryteLocation.FIrmamentEasternRisensongQuarter => _aethernetTeleportByPlaceNameId.InvokeFunc(3645u), EAetheryteLocation.None => throw new ArgumentOutOfRangeException("aetheryteLocation"), _ => _aethernetTeleportById.InvokeFunc((uint)aetheryteLocation), }; } }