2022-01-14 14:30:54 -08:00
|
|
|
|
using Mirror;
|
|
|
|
|
using QSB.Messaging;
|
2022-01-11 19:10:24 -08:00
|
|
|
|
using QSB.QuantumSync.WorldObjects;
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2022-01-14 14:30:54 -08:00
|
|
|
|
public override void Serialize(NetworkWriter writer)
|
2022-01-11 19:10:24 -08:00
|
|
|
|
{
|
|
|
|
|
base.Serialize(writer);
|
2022-01-11 19:31:54 -08:00
|
|
|
|
writer.Write(_index);
|
2022-01-11 19:10:24 -08:00
|
|
|
|
}
|
|
|
|
|
|
2022-01-14 14:30:54 -08:00
|
|
|
|
public override void Deserialize(NetworkReader reader)
|
2022-01-11 19:10:24 -08:00
|
|
|
|
{
|
|
|
|
|
base.Deserialize(reader);
|
2022-01-14 14:30:54 -08:00
|
|
|
|
_index = reader.ReadInt();
|
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
|
|
|
|
}
|
|
|
|
|
}
|