| using System; |
| using System; |
| using System.Collections.Generic; |
| using System.Collections.Generic; |
| |
| |
| public class AscendUpgradeContainer : ContentContainer |
| public class AscendUpgradeContainer : ContentContainer |
| { |
| { |
| private AscendUpgradeContainer() |
| private AscendUpgradeContainer() |
| { |
| { |
| this.contentName = "ascend_upgrades_parameters"; |
| this.contentName = "ascend_upgrades_parameters"; |
| this.upgrades = new List<AscendUpgradeData>(); |
| this.upgrades = new List<AscendUpgradeData>(); |
| } |
| } |
| |
| |
| public static AscendUpgradeContainer Instance |
| public static AscendUpgradeContainer Instance |
| { |
| { |
| get |
| get |
| { |
| { |
| if (AscendUpgradeContainer.instance == null) |
| if (AscendUpgradeContainer.instance == null) |
| { |
| { |
| AscendUpgradeContainer.instance = new AscendUpgradeContainer(); |
| AscendUpgradeContainer.instance = new AscendUpgradeContainer(); |
| } |
| } |
| return AscendUpgradeContainer.instance; |
| return AscendUpgradeContainer.instance; |
| } |
| } |
| } |
| } |
| |
| |
| public List<AscendUpgradeData> GetUpgrades() |
| public List<AscendUpgradeData> GetUpgrades() |
| { |
| { |
| return this.upgrades; |
| return this.upgrades; |
| } |
| } |
| |
| |
| protected override void LoadContent(string[] count, string[] lines) |
| protected override void LoadContent(string[] count, string[] lines) |
| { |
| { |
| for (int i = 0; i < count.Length; i++) |
| for (int i = 0; i < count.Length; i++) |
| { |
| { |
| this.upgrades.Add(new AscendUpgradeData(count[i])); |
| this.upgrades.Add(new AscendUpgradeData(count[i])); |
| this.upgrades[i].Load(i, lines); |
| this.upgrades[i].Load(i, lines); |
| } |
| } |
| } |
| } |
| |
| |
| public int GetUpgradeCost(int type, int level) |
| public int GetUpgradeCost(int type, int level) |
| { |
| { |
| if (type <= this.upgrades.Count) |
| if (type <= this.upgrades.Count) |
| { |
| { |
. | return this.upgrades[type - 1].GetUpgradeCost(level); |
| return -9999; |
| } |
| } |
| return 0; |
| return 0; |
| } |
| } |
| |
| |
| public float GetUpgradeBonusValue(int type, int level) |
| public float GetUpgradeBonusValue(int type, int level) |
| { |
| { |
| if (type <= this.upgrades.Count) |
| if (type <= this.upgrades.Count) |
| { |
| { |
| return this.upgrades[type - 1].GetBonusValue(level); |
| return this.upgrades[type - 1].GetBonusValue(level); |
| } |
| } |
| return 0f; |
| return 0f; |
| } |
| } |
| |
| |
| public float GetUpgradeBonusGold(int type, int level) |
| public float GetUpgradeBonusGold(int type, int level) |
| { |
| { |
| if (type <= this.upgrades.Count) |
| if (type <= this.upgrades.Count) |
| { |
| { |
| return this.upgrades[type - 1].GetBonusGold(level); |
| return this.upgrades[type - 1].GetBonusGold(level); |
| } |
| } |
| return 0f; |
| return 0f; |
| } |
| } |
| |
| |
| public int GetMaxLevel(int type) |
| public int GetMaxLevel(int type) |
| { |
| { |
| if (type <= this.upgrades.Count) |
| if (type <= this.upgrades.Count) |
| { |
| { |
| return this.upgrades[type - 1].GetMaxLevel(); |
| return this.upgrades[type - 1].GetMaxLevel(); |
| } |
| } |
| return 0; |
| return 0; |
| } |
| } |
| |
| |
| private static AscendUpgradeContainer instance; |
| private static AscendUpgradeContainer instance; |
| |
| |
| private List<AscendUpgradeData> upgrades; |
| private List<AscendUpgradeData> upgrades; |
| } |
| } |
| |
| |