2022-01-11 19:10:24 -08:00
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using QSB.QuantumSync.WorldObjects;
|
|
|
|
|
using QuantumUNET.Transport;
|
|
|
|
|
|
|
|
|
|
namespace QSB.QuantumSync.Messages
|
|
|
|
|
{
|
|
|
|
|
internal class MoveSkeletonMessage : QSBWorldObjectMessage<QSBQuantumSkeletonTower>
|
|
|
|
|
{
|
2022-01-11 19:31:54 -08:00
|
|
|
|
private int _index;
|
2022-01-11 19:10:24 -08:00
|
|
|
|
|
2022-01-11 19:31:54 -08:00
|
|
|
|
public MoveSkeletonMessage(int index) => _index = index;
|
2022-01-11 19:10:24 -08:00
|
|
|
|
|
|
|
|
|
public override void Serialize(QNetworkWriter writer)
|
|
|
|
|
{
|
|
|
|
|
base.Serialize(writer);
|
2022-01-11 19:31:54 -08:00
|
|
|
|
writer.Write(_index);
|
2022-01-11 19:10:24 -08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Deserialize(QNetworkReader reader)
|
|
|
|
|
{
|
|
|
|
|
base.Deserialize(reader);
|
2022-01-11 19:31:54 -08:00
|
|
|
|
_index = reader.ReadInt32();
|
2022-01-11 19:10:24 -08:00
|
|
|
|
}
|
|
|
|
|
|
2022-01-11 19:31:54 -08:00
|
|
|
|
public override void OnReceiveRemote() => WorldObject.MoveSkeleton(_index);
|
2022-01-11 19:10:24 -08:00
|
|
|
|
}
|
|
|
|
|
}
|