mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2024-12-28 18:25:18 +00:00
27 lines
714 B
C#
27 lines
714 B
C#
using QSB.Events;
|
|
using QSB.Messaging;
|
|
|
|
namespace QSB.ShipSync.Messages
|
|
{
|
|
internal class FunnelEnableEvent : QSBEvent<PlayerMessage>
|
|
{
|
|
public override bool RequireWorldObjectsReady => true;
|
|
|
|
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()
|
|
{
|
|
AboutId = LocalPlayerId
|
|
};
|
|
|
|
public override void OnReceiveRemote(bool server, PlayerMessage message)
|
|
=> ShipManager.Instance.ShipTractorBeam.ActivateTractorBeam();
|
|
}
|
|
}
|