2021-12-26 01:21:54 +00:00
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using QSB.WorldSync;
|
|
|
|
|
|
|
|
|
|
namespace QSB.ShipSync.Messages
|
|
|
|
|
{
|
2022-01-27 04:35:43 +00:00
|
|
|
|
internal class HatchMessage : QSBMessage<bool>
|
2021-12-26 01:21:54 +00:00
|
|
|
|
{
|
|
|
|
|
public HatchMessage(bool open) => Value = open;
|
|
|
|
|
|
2022-01-18 08:27:32 +00:00
|
|
|
|
public override bool ShouldReceive => QSBWorldSync.AllObjectsReady;
|
2021-12-26 01:21:54 +00:00
|
|
|
|
|
|
|
|
|
public override void OnReceiveRemote()
|
|
|
|
|
{
|
|
|
|
|
if (Value)
|
|
|
|
|
{
|
|
|
|
|
ShipManager.Instance.HatchController.OpenHatch();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ShipManager.Instance.ShipTractorBeam.DeactivateTractorBeam();
|
|
|
|
|
ShipManager.Instance.HatchController.CloseHatch();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|