From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/DragonCoinCostHandler.cs | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/DragonCoinCostHandler.cs (limited to 'Client/Assets/Scripts/XMainClient/DragonCoinCostHandler.cs') diff --git a/Client/Assets/Scripts/XMainClient/DragonCoinCostHandler.cs b/Client/Assets/Scripts/XMainClient/DragonCoinCostHandler.cs new file mode 100644 index 00000000..4ab01972 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/DragonCoinCostHandler.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; + +namespace XMainClient +{ + internal class DragonCoinCostHandler : ICostHandler + { + private List m_Costs = new List(); + + public CostInfo GetCost(int i) + { + CostInfo result; + result.type = ItemEnum.DRAGON_COIN; + bool flag = this.m_Costs.Count == 0; + if (flag) + { + result.count = 0u; + } + else + { + bool flag2 = i >= 0 && i < this.m_Costs.Count; + if (flag2) + { + result.count = this.m_Costs[i]; + } + else + { + result.count = this.m_Costs[this.m_Costs.Count - 1]; + } + } + return result; + } + + public bool ParseCostConfigString(string str) + { + string[] array = str.Split(XGlobalConfig.ListSeparator); + uint num = 0u; + while ((ulong)num < (ulong)((long)array.Length)) + { + this.m_Costs.Add(uint.Parse(array[(int)num])); + num += 1u; + } + return true; + } + } +} -- cgit v1.1-26-g67d0