server-master/srcs/_plugins/Plugin.TimeSpaces/Scripting/STogglePortalEventConverter.cs
2026-02-10 18:21:30 +01:00

22 lines
No EOL
689 B
C#

using System;
using System.Collections.Generic;
using PhoenixLib.Events;
using WingsAPI.Scripting.Converter;
using WingsAPI.Scripting.Event.TimeSpace;
using WingsEmu.Game;
using WingsEmu.Game.TimeSpaces.Events;
namespace Plugin.TimeSpaces.Scripting;
public class STogglePortalEventConverter : ScriptedEventConverter<STogglePortalEvent>
{
private readonly Dictionary<Guid, IPortalEntity> _portals;
public STogglePortalEventConverter(Dictionary<Guid, IPortalEntity> portals) => _portals = portals;
protected override IAsyncEvent Convert(STogglePortalEvent e) =>
new TimeSpaceTogglePortalEvent
{
PortalEntity = _portals[e.Portal.Id]
};
}