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