From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Assets/Scripts/XMainClient/KKSG/FriendGift.cs | 105 +++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/KKSG/FriendGift.cs (limited to 'Client/Assets/Scripts/XMainClient/KKSG/FriendGift.cs') diff --git a/Client/Assets/Scripts/XMainClient/KKSG/FriendGift.cs b/Client/Assets/Scripts/XMainClient/KKSG/FriendGift.cs new file mode 100644 index 00000000..5ad2cf49 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/KKSG/FriendGift.cs @@ -0,0 +1,105 @@ +using System; +using System.ComponentModel; +using System.Xml.Serialization; +using ProtoBuf; + +namespace KKSG +{ + [ProtoContract(Name = "FriendGift")] + [Serializable] + public class FriendGift : IExtensible + { + [ProtoMember(1, IsRequired = false, Name = "SendLeft", DataFormat = DataFormat.TwosComplement)] + public uint SendLeft + { + get + { + return this._SendLeft ?? 0u; + } + set + { + this._SendLeft = new uint?(value); + } + } + + [XmlIgnore] + [Browsable(false)] + public bool SendLeftSpecified + { + get + { + return this._SendLeft != null; + } + set + { + bool flag = value == (this._SendLeft == null); + if (flag) + { + this._SendLeft = (value ? new uint?(this.SendLeft) : null); + } + } + } + + [ProtoMember(2, IsRequired = false, Name = "ReceiveLeft", DataFormat = DataFormat.TwosComplement)] + public uint ReceiveLeft + { + get + { + return this._ReceiveLeft ?? 0u; + } + set + { + this._ReceiveLeft = new uint?(value); + } + } + + [XmlIgnore] + [Browsable(false)] + public bool ReceiveLeftSpecified + { + get + { + return this._ReceiveLeft != null; + } + set + { + bool flag = value == (this._ReceiveLeft == null); + if (flag) + { + this._ReceiveLeft = (value ? new uint?(this.ReceiveLeft) : null); + } + } + } + + private uint? _SendLeft; + + private uint? _ReceiveLeft; + + private IExtension extensionObject; + + private bool ShouldSerializeSendLeft() + { + return this.SendLeftSpecified; + } + + private void ResetSendLeft() + { + this.SendLeftSpecified = false; + } + + private bool ShouldSerializeReceiveLeft() + { + return this.ReceiveLeftSpecified; + } + + private void ResetReceiveLeft() + { + this.ReceiveLeftSpecified = false; + } + + IExtension IExtensible.GetExtensionObject(bool createIfMissing) + { + return Extensible.GetExtensionObject(ref this.extensionObject, createIfMissing); + } + } +} -- cgit v1.1-26-g67d0