private void ApplyAbilityEffect(Ability ability, Fraction targetFraction) { foreach (var constraint in ability.effect.constraints) { if (!constraint.fractions.Contains(targetFraction.id) && (constraint.climateZone != climateZone || constraint.climateZone != ClimateZone.All) && (constraint.continent != continent || constraint.continent != Continent.All) && (constraint.politicalSystem == politicalSystem || constraint.politicalSystem != PoliticalSystem.All) && constraint.minClimateRiskIndex <= climateRiskIndex && constraint.minEducationLevel <= educationLevel && constraint.minHumanDevelopmentIndex <= humanDevelopmentIndex) { return; } } targetFraction.ApplyAbilityEffect(ability.effect); }