using Cyber.Items; using UnityEngine.Networking; namespace Cyber.Networking.Messages { /// /// Packet containing an inventory action of a kind. /// public class InventoryActionPkt : MessageBase { /// /// The inventory action. /// public InventoryAction Action; /// /// The related int to the /// public int RelatedInt; /// /// The inventory SyncBaseID this happened in. Only set by server. /// public int SyncBaseID; /// /// Creates an inventory action packet for sending. /// /// The action done. /// public InventoryActionPkt(InventoryAction action, int relatedInt) { Action = action; RelatedInt = relatedInt; } /// /// Creates an inventory action packet for deserializing. /// public InventoryActionPkt() {} /// /// Deserializes the /// /// public override void Deserialize(NetworkReader reader) { Action = (InventoryAction) reader.ReadByte(); RelatedInt = reader.ReadInt32(); SyncBaseID = reader.ReadInt32(); } /// /// Serializes the /// /// public override void Serialize(NetworkWriter writer) { writer.Write((byte) Action); writer.Write(RelatedInt); writer.Write(SyncBaseID); } } }