24 lines
501 B
C#
Raw Normal View History

2021-12-25 17:21:54 -08:00
using QSB.Messaging;
using QSB.WorldSync;
2022-03-02 19:46:33 -08:00
namespace QSB.ShipSync.Messages;
2023-07-28 19:30:57 +01:00
public class HatchMessage : QSBMessage<bool>
2021-12-25 17:21:54 -08:00
{
2022-03-10 17:57:50 -08:00
public HatchMessage(bool open) : base(open) { }
2021-12-25 17:21:54 -08:00
2022-03-02 19:46:33 -08:00
public override bool ShouldReceive => QSBWorldSync.AllObjectsReady;
2021-12-25 17:21:54 -08:00
2022-03-02 19:46:33 -08:00
public override void OnReceiveRemote()
{
if (Data)
{
ShipManager.Instance.HatchController.OpenHatch();
}
else
2021-12-25 17:21:54 -08:00
{
2022-03-02 19:46:33 -08:00
ShipManager.Instance.ShipTractorBeam.DeactivateTractorBeam();
ShipManager.Instance.HatchController.CloseHatch();
2021-12-25 17:21:54 -08:00
}
}
}