quantum-space-buddies/QSB/Tools/ProbeLauncherTool/Messages/RemoveSnapshotMessage.cs
2023-07-28 19:30:57 +01:00

27 lines
660 B
C#

using QSB.Messaging;
using QSB.Player;
using QSB.Player.TransformSync;
using QSB.QuantumSync;
namespace QSB.Tools.ProbeLauncherTool.Messages;
public class RemoveSnapshotMessage : QSBMessage
{
static RemoveSnapshotMessage()
=> GlobalMessenger.AddListener(OWEvents.ProbeSnapshotRemoved, Handle);
private static void Handle()
{
if (PlayerTransformSync.LocalInstance)
{
new RemoveSnapshotMessage().Send();
}
}
public override void OnReceiveLocal()
=> QuantumManager.OnRemoveProbeSnapshot(QSBPlayerManager.LocalPlayer);
public override void OnReceiveRemote()
=> QuantumManager.OnRemoveProbeSnapshot(QSBPlayerManager.GetPlayer(From));
}