2021-12-23 01:50:09 -08:00
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using QSB.OrbSync.WorldObjects;
|
2020-12-16 09:08:38 +00:00
|
|
|
|
using QuantumUNET.Transport;
|
2020-12-07 18:49:51 +00:00
|
|
|
|
|
2021-12-23 02:17:56 -08:00
|
|
|
|
namespace QSB.OrbSync.Messages
|
2020-12-07 18:49:51 +00:00
|
|
|
|
{
|
2021-12-23 01:50:09 -08:00
|
|
|
|
public class OrbSlotMessage : QSBWorldObjectMessage<QSBOrb>
|
2020-12-07 18:49:51 +00:00
|
|
|
|
{
|
2021-12-23 01:50:09 -08:00
|
|
|
|
private int SlotIndex;
|
2020-12-07 18:49:51 +00:00
|
|
|
|
|
2021-12-23 01:50:09 -08:00
|
|
|
|
public OrbSlotMessage(int slotIndex) => SlotIndex = slotIndex;
|
|
|
|
|
|
2020-12-23 12:58:45 +00:00
|
|
|
|
public override void Serialize(QNetworkWriter writer)
|
2020-12-07 18:49:51 +00:00
|
|
|
|
{
|
|
|
|
|
base.Serialize(writer);
|
2021-12-14 23:57:21 -08:00
|
|
|
|
writer.Write(SlotIndex);
|
2020-12-07 18:49:51 +00:00
|
|
|
|
}
|
2021-12-23 01:50:09 -08:00
|
|
|
|
|
|
|
|
|
public override void Deserialize(QNetworkReader reader)
|
|
|
|
|
{
|
|
|
|
|
base.Deserialize(reader);
|
|
|
|
|
SlotIndex = reader.ReadInt32();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnReceiveRemote() => WorldObject.SetSlot(SlotIndex);
|
2020-12-07 18:49:51 +00:00
|
|
|
|
}
|
2021-12-23 01:50:09 -08:00
|
|
|
|
}
|