protected void AddUpgradeSlot(Upgrade.UpgradeSlot slot) { if (!BuiltInSlots.ContainsKey(slot)) { BuiltInSlots.Add(slot, 1); } else { BuiltInSlots[slot]++; } }
private bool HasFreeUpgradeSlot(Upgrade.UpgradeSlot slot) { bool result = false; if (BuiltInSlots.ContainsKey(slot)) { int slotsAvailabe = BuiltInSlots[slot]; foreach (var upgrade in InstalledUpgrades) { if (upgrade.Key == slot) { slotsAvailabe--; } } if (slotsAvailabe > 0) { result = true; } } return(result); }