2021-06-14 15:13:32 +00:00
|
|
|
|
using QSB.Events;
|
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
|
2021-12-24 00:26:31 +00:00
|
|
|
|
namespace QSB.ShipSync.Messages
|
2021-06-14 15:13:32 +00:00
|
|
|
|
{
|
2021-07-12 21:02:50 +00:00
|
|
|
|
internal class FunnelEnableEvent : QSBEvent<PlayerMessage>
|
2021-06-14 15:13:32 +00:00
|
|
|
|
{
|
2021-12-05 11:03:09 +00:00
|
|
|
|
public override bool RequireWorldObjectsReady => true;
|
2021-12-04 16:39:37 +00:00
|
|
|
|
|
2021-06-14 15:13:32 +00:00
|
|
|
|
public override void SetupListener()
|
|
|
|
|
=> GlobalMessenger.AddListener(EventNames.QSBEnableFunnel, Handler);
|
|
|
|
|
|
|
|
|
|
public override void CloseListener()
|
|
|
|
|
=> GlobalMessenger.RemoveListener(EventNames.QSBEnableFunnel, Handler);
|
|
|
|
|
|
|
|
|
|
private void Handler() => SendEvent(CreateMessage());
|
|
|
|
|
|
2021-11-20 19:49:50 +00:00
|
|
|
|
private PlayerMessage CreateMessage() => new()
|
2021-06-14 15:13:32 +00:00
|
|
|
|
{
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|