public void UpgradeUnitEquipment(int unitId) { var(data, unit) = _units.GetUnit(unitId); if (!_units.IsFullEquipment(unitId)) { throw new Exception($"The unit does not have all the equipment for pumping. id = {unitId}"); } if (unit.EquipmentRarities.TryGetValue(data.EquipmentStars - 1, out var rarity)) { foreach (var price in rarity.Prices) { _scorers.Spend(price.Value, _formula); } } data.Equipment.Clear(); data.EquipmentStars += 1; LogicLog.UpgradeEquipRarity(unitId, data.EquipmentStars); _impact.ExecuteContextImpact(unit.ImpactUpdrade, unitId); }