| using System; |
| using System; |
| using System.Collections.Generic; |
| using System.Collections.Generic; |
| |
| |
| public class AscendParametersDataContainer |
| public class AscendParametersDataContainer |
| { |
| { |
| private AscendParametersDataContainer() |
| private AscendParametersDataContainer() |
| { |
| { |
| this.upgradeData = new List<AscendCostData>(); |
| this.upgradeData = new List<AscendCostData>(); |
| } |
| } |
| |
| |
| public static AscendParametersDataContainer Instance |
| public static AscendParametersDataContainer Instance |
| { |
| { |
| get |
| get |
| { |
| { |
| if (AscendParametersDataContainer.instance == null) |
| if (AscendParametersDataContainer.instance == null) |
| { |
| { |
| AscendParametersDataContainer.instance = new AscendParametersDataContainer(); |
| AscendParametersDataContainer.instance = new AscendParametersDataContainer(); |
| } |
| } |
| return AscendParametersDataContainer.instance; |
| return AscendParametersDataContainer.instance; |
| } |
| } |
| } |
| } |
| |
| |
| public List<AscendCostData> GetUpgradeData() |
| public List<AscendCostData> GetUpgradeData() |
| { |
| { |
| return this.upgradeData; |
| return this.upgradeData; |
| } |
| } |
| |
| |
| public void Load() |
| public void Load() |
| { |
| { |
| string text = ContentManager.LoadContentRemote("ascend_parameters"); |
| string text = ContentManager.LoadContentRemote("ascend_parameters"); |
| if (text == null || text == string.Empty) |
| if (text == null || text == string.Empty) |
| { |
| { |
| text = ContentManager.LoadContent("ascend_parameters"); |
| text = ContentManager.LoadContent("ascend_parameters"); |
| } |
| } |
| string[] array = text.Split(new char[] |
| string[] array = text.Split(new char[] |
| { |
| { |
| '\n', |
| '\n', |
| '\r' |
| '\r' |
| }, StringSplitOptions.RemoveEmptyEntries); |
| }, StringSplitOptions.RemoveEmptyEntries); |
| for (int i = 1; i < array.Length; i++) |
| for (int i = 1; i < array.Length; i++) |
| { |
| { |
| string[] array2 = array[i].Split(new char[] |
| string[] array2 = array[i].Split(new char[] |
| { |
| { |
| '\t' |
| '\t' |
| }, StringSplitOptions.RemoveEmptyEntries); |
| }, StringSplitOptions.RemoveEmptyEntries); |
| AscendCostData item = default(AscendCostData); |
| AscendCostData item = default(AscendCostData); |
| item.upgradeCount = int.Parse(array2[1]); |
| item.upgradeCount = int.Parse(array2[1]); |
| item.upgradeCost = int.Parse(array2[2]); |
| item.upgradeCost = int.Parse(array2[2]); |
| item.rerollPremiumCost = int.Parse(array2[3]); |
| item.rerollPremiumCost = int.Parse(array2[3]); |
| this.upgradeData.Add(item); |
| this.upgradeData.Add(item); |
| } |
| } |
| } |
| } |
| |
| |
| public BigNumber GetNewAscendCost(int ascendCount) |
| public BigNumber GetNewAscendCost(int ascendCount) |
| { |
| { |
| if (ascendCount >= this.upgradeData.Count || ascendCount < 0) |
| if (ascendCount >= this.upgradeData.Count || ascendCount < 0) |
| { |
| { |
| return new BigNumber(0.0); |
| return new BigNumber(0.0); |
| } |
| } |
. | return this.upgradeData[ascendCount].upgradeCost; |
| return -9999; |
| } |
| } |
| |
| |
| public BigNumber GetRerollAscendPremiumCost(int ascendCount) |
| public BigNumber GetRerollAscendPremiumCost(int ascendCount) |
| { |
| { |
| BigNumber result; |
| BigNumber result; |
| if (ascendCount > 21) |
| if (ascendCount > 21) |
| { |
| { |
| result = 1100.0; |
| result = 1100.0; |
| } |
| } |
| else |
| else |
| { |
| { |
| result = this.upgradeData[ascendCount].rerollPremiumCost; |
| result = this.upgradeData[ascendCount].rerollPremiumCost; |
| } |
| } |
| return result; |
| return result; |
| } |
| } |
| |
| |
| private static AscendParametersDataContainer instance; |
| private static AscendParametersDataContainer instance; |
| |
| |
| private List<AscendCostData> upgradeData; |
| private List<AscendCostData> upgradeData; |
| |
| |
| private const string contentName = "ascend_parameters"; |
| private const string contentName = "ascend_parameters"; |
| } |
| } |
| |
| |