override public void CityContribution(QOLCity city, Dictionary <QOLCityNeedDef, NumericAdjustment> needContribution, Dictionary <QOLCityNeedDef, NumericAdjustment> needRequirements, Dictionary <QOLSocietyIndicatorDef, NumericAdjustment> indicatorContribution) { if (indicatorContribution.ContainsKey(indicator)) { indicatorContribution[indicator].flat += RelevantPopulationCount(city) * multiplierPopulationCount; } }
protected int RelevantPopulationCount(QOLCity city) { int relevantPopulationCount = city.population.citizens.Count; if (!pawnFilters.NullOrEmpty()) { foreach (Pawn p in city.population.citizens.Keys) { if (pawnFilters.Any(filter => !filter.IsAllowed(city, p))) { relevantPopulationCount--; } } } return(relevantPopulationCount); }
override public void CityContribution(QOLCity city, Dictionary <QOLCityNeedDef, NumericAdjustment> needContribution, Dictionary <QOLCityNeedDef, NumericAdjustment> needRequirements, Dictionary <QOLSocietyIndicatorDef, NumericAdjustment> indicatorContribution) { Dictionary <QOLCityNeedDef, NumericAdjustment> dic; if (isRequirement) { dic = needRequirements; } else { dic = needContribution; } if (dic.ContainsKey(need)) { needRequirements[need].flat += RelevantPopulationCount(city) * multiplierPopulationCount; } }
override public bool IsValid(QOLCity city) { return(min <= city.population.citizens.Count && city.population.citizens.Count <= max); }
//min and max validation for population count, indicators, need requirements, need contributions //exist and not exist validation for indicator stages, projects, matching citizen(s), later stories maybee. abstract public bool IsValid(QOLCity city);
public override bool IsAllowed(QOLCity city, Pawn p) { return(!filter.IsAllowed(city, p)); }
public override bool IsAllowed(QOLCity city, Pawn p) { return(p.RaceProps.IsFlesh); }
abstract public bool IsAllowed(QOLCity city, Pawn p);
abstract public void CityContribution(QOLCity city, Dictionary <QOLCityNeedDef, NumericAdjustment> needContribution, Dictionary <QOLCityNeedDef, NumericAdjustment> needRequirements, Dictionary <QOLSocietyIndicatorDef, NumericAdjustment> indicatorContribution);
override public bool IsAllowed(QOLCity city, Pawn p) { return(p != null && p.RaceProps != null && p.RaceProps.Animal); }
override public bool IsAllowed(QOLCity city, Pawn p) { return(p != null && p.RaceProps != null && p.RaceProps.Humanlike); }
public bool IsImmigrationAllowed(QOLCity city, Pawn p) { return(!immigrationLaws.Any(il => !il.IsAllowed(city, p))); }