summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/DragonCoinCostHandler.cs
blob: 4ab019724adb0639c1c7899a19f272637d48f625 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;

namespace XMainClient
{
	internal class DragonCoinCostHandler : ICostHandler
	{
		private List<uint> m_Costs = new List<uint>();

		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;
		}
	}
}