From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/Equip/EquipSuitItemData.cs | 121 +++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/Equip/EquipSuitItemData.cs (limited to 'Client/Assets/Scripts/XMainClient/Equip/EquipSuitItemData.cs') diff --git a/Client/Assets/Scripts/XMainClient/Equip/EquipSuitItemData.cs b/Client/Assets/Scripts/XMainClient/Equip/EquipSuitItemData.cs new file mode 100644 index 00000000..1cbaf4d1 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Equip/EquipSuitItemData.cs @@ -0,0 +1,121 @@ +using System; +using XUtliPoolLib; + +namespace XMainClient +{ + public class EquipSuitItemData : IComparable + { + public int CompareValue + { + get + { + bool flag = this.itemComposeData == null; + int result; + if (flag) + { + result = int.MinValue; + } + else + { + int num = (int)XBagDocument.BagDoc.GetItemCount(this.itemComposeData.SrcItem1[0]) - this.itemComposeData.SrcItem1[1]; + bool flag2 = num < 0; + if (flag2) + { + result = num; + } + else + { + int num2 = (int)XBagDocument.BagDoc.GetItemCount(this.itemComposeData.SrcItem2[0]) - this.itemComposeData.SrcItem2[1]; + bool flag3 = num2 < 0; + if (flag3) + { + result = num2; + } + else + { + int num3 = (int)XBagDocument.BagDoc.GetItemCount(this.itemComposeData.SrcItem3[0]) - this.itemComposeData.SrcItem3[1]; + bool flag4 = num3 < 0; + if (flag4) + { + result = num3; + } + else + { + int num4 = (int)XBagDocument.BagDoc.GetItemCount(XEquipCreateDocument.CoinId) - this.itemComposeData.Coin; + bool flag5 = num4 < 0; + if (flag5) + { + result = num4; + } + else + { + result = num + num2 + num3 + num4; + } + } + } + } + } + return result; + } + } + + public bool redpoint; + + public EquipList.RowData itemData; + + public ItemComposeTable.RowData itemComposeData; + + public int CompareTo(object _other) + { + EquipSuitItemData equipSuitItemData = _other as EquipSuitItemData; + bool flag = this.itemComposeData != null && equipSuitItemData.itemComposeData != null; + if (flag) + { + bool flag2 = this.itemComposeData.Level != equipSuitItemData.itemComposeData.Level; + if (flag2) + { + return this.itemComposeData.Level - equipSuitItemData.itemComposeData.Level; + } + } + int compareValue = this.CompareValue; + int compareValue2 = equipSuitItemData.CompareValue; + bool flag3 = compareValue >= 0; + if (flag3) + { + bool flag4 = compareValue2 < 0; + if (flag4) + { + return -1; + } + } + else + { + bool flag5 = compareValue2 >= 0; + if (flag5) + { + return 1; + } + } + int[] equipPosOrderArray = XSingleton.singleton.EquipPosOrderArray; + bool flag6 = equipPosOrderArray[(int)this.itemData.EquipPos] == equipPosOrderArray[(int)equipSuitItemData.itemData.EquipPos]; + int result; + if (flag6) + { + bool flag7 = compareValue == compareValue2; + if (flag7) + { + result = this.itemComposeData.Coin - equipSuitItemData.itemComposeData.Coin; + } + else + { + result = compareValue2 - compareValue; + } + } + else + { + result = equipPosOrderArray[(int)this.itemData.EquipPos] - equipPosOrderArray[(int)equipSuitItemData.itemData.EquipPos]; + } + return result; + } + } +} -- cgit v1.1-26-g67d0