quantum-space-buddies/QSB/Tools/ProbeTool/Messages/ProbeStartRetrieveMessage.cs

26 lines
555 B
C#
Raw Normal View History

2021-12-26 07:45:40 +00:00
using QSB.Messaging;
using QSB.Player;
using QSB.WorldSync;
namespace QSB.Tools.ProbeTool.Messages
{
internal class ProbeStartRetrieveMessage : QSBFloatMessage
{
public ProbeStartRetrieveMessage(float duration) => Value = duration;
2021-12-27 04:12:50 +00:00
public override bool ShouldReceive => WorldObjectManager.AllObjectsReady;
2021-12-26 07:45:40 +00:00
public override void OnReceiveRemote()
{
var player = QSBPlayerManager.GetPlayer(From);
if (!player.IsReady || player.Probe == null)
{
return;
}
var probe = player.Probe;
probe.OnStartRetrieve(Value);
}
}
}