quantum-space-buddies/QSB/ShipSync/Messages/HatchMessage.cs
2022-02-25 23:18:46 -08:00

24 lines
504 B
C#

using QSB.Messaging;
using QSB.WorldSync;
namespace QSB.ShipSync.Messages;
internal class HatchMessage : QSBMessage<bool>
{
public HatchMessage(bool open) => Value = open;
public override bool ShouldReceive => QSBWorldSync.AllObjectsReady;
public override void OnReceiveRemote()
{
if (Value)
{
ShipManager.Instance.HatchController.OpenHatch();
}
else
{
ShipManager.Instance.ShipTractorBeam.DeactivateTractorBeam();
ShipManager.Instance.HatchController.CloseHatch();
}
}
}