quantum-space-buddies/QSB/ShipSync/Events/FunnelEnableEvent.cs

27 lines
727 B
C#
Raw Normal View History

2021-06-14 15:13:32 +00:00
using QSB.Events;
using QSB.Messaging;
namespace QSB.ShipSync.Events
{
2021-07-12 21:02:50 +00:00
internal class FunnelEnableEvent : QSBEvent<PlayerMessage>
2021-06-14 15:13:32 +00:00
{
public override EventType Type => EventType.EnableFunnel;
public override void SetupListener()
=> GlobalMessenger.AddListener(EventNames.QSBEnableFunnel, Handler);
public override void CloseListener()
=> GlobalMessenger.RemoveListener(EventNames.QSBEnableFunnel, Handler);
private void Handler() => SendEvent(CreateMessage());
private PlayerMessage CreateMessage() => new PlayerMessage
{
AboutId = LocalPlayerId
};
2021-06-19 10:26:05 +00:00
public override void OnReceiveRemote(bool server, PlayerMessage message)
2021-06-14 15:13:32 +00:00
=> ShipManager.Instance.ShipTractorBeam.ActivateTractorBeam();
}
}