Exemplo n.º 1
0
    public List <ITownUpgrade> GetUpgrades(string treeId, string code)
    {
        List <ITownUpgrade> foundUpgrades = new List <ITownUpgrade>();
        ITownUpgrade        upgrade       = PositiveQuirkUpgrades.Find(item => item.TreeId == treeId && item.UpgradeCode == code);

        if (upgrade != null)
        {
            foundUpgrades.Add(upgrade);
        }
        upgrade = NegativeQuirkUpgrades.Find(item => item.TreeId == treeId && item.UpgradeCode == code);
        if (upgrade != null)
        {
            foundUpgrades.Add(upgrade);
        }
        upgrade = PermNegativeUpgrades.Find(item => item.TreeId == treeId && item.UpgradeCode == code);
        if (upgrade != null)
        {
            foundUpgrades.Add(upgrade);
        }
        upgrade = SlotUpgrades.Find(item => item.TreeId == treeId && item.UpgradeCode == code);
        if (upgrade != null)
        {
            foundUpgrades.Add(upgrade);
        }
        return(foundUpgrades);
    }
Exemplo n.º 2
0
    public ITownUpgrade GetUpgradeByCode(string code)
    {
        ITownUpgrade upgrade = CostUpgrades.Find(item => item.UpgradeCode == code);

        if (upgrade != null)
        {
            return(upgrade);
        }
        upgrade = SlotUpgrades.Find(item => item.UpgradeCode == code);
        if (upgrade != null)
        {
            return(upgrade);
        }
        upgrade = StressUpgrades.Find(item => item.UpgradeCode == code);
        return(upgrade);
    }
    public List <ITownUpgrade> GetUpgrades(string treeId, string code)
    {
        List <ITownUpgrade> foundUpgrades = new List <ITownUpgrade>();
        ITownUpgrade        upgrade       = DiseaseTreatmentUpgrades.Find(item => item.TreeId == treeId && item.UpgradeCode == code);

        if (upgrade != null)
        {
            foundUpgrades.Add(upgrade);
        }
        upgrade = CureAllUpgrades.Find(item => item.TreeId == treeId && item.UpgradeCode == code);
        if (upgrade != null)
        {
            foundUpgrades.Add(upgrade);
        }
        upgrade = SlotUpgrades.Find(item => item.TreeId == treeId && item.UpgradeCode == code);
        if (upgrade != null)
        {
            foundUpgrades.Add(upgrade);
        }
        return(foundUpgrades);
    }