mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-06 01:00:16 +00:00
35 lines
839 B
C#
35 lines
839 B
C#
using QSB.Messaging;
|
|
using QSB.MeteorSync.WorldObjects;
|
|
using QuantumUNET.Transport;
|
|
|
|
namespace QSB.MeteorSync.Messages
|
|
{
|
|
public class MeteorLaunchMessage : QSBWorldObjectMessage<QSBMeteorLauncher>
|
|
{
|
|
private int MeteorId;
|
|
private float LaunchSpeed;
|
|
|
|
public MeteorLaunchMessage(QSBMeteorLauncher qsbMeteorLauncher)
|
|
{
|
|
MeteorId = qsbMeteorLauncher.MeteorId;
|
|
LaunchSpeed = qsbMeteorLauncher.LaunchSpeed;
|
|
}
|
|
|
|
public override void Serialize(QNetworkWriter writer)
|
|
{
|
|
base.Serialize(writer);
|
|
writer.Write(MeteorId);
|
|
writer.Write(LaunchSpeed);
|
|
}
|
|
|
|
public override void Deserialize(QNetworkReader reader)
|
|
{
|
|
base.Deserialize(reader);
|
|
MeteorId = reader.ReadInt32();
|
|
LaunchSpeed = reader.ReadSingle();
|
|
}
|
|
|
|
public override void OnReceiveRemote() => WorldObject.LaunchMeteor(MeteorId, LaunchSpeed);
|
|
}
|
|
}
|