예제 #1
0
 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;
     }
 }
예제 #2
0
        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);
        }
예제 #3
0
        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;
            }
        }
예제 #4
0
 override public bool IsValid(QOLCity city)
 {
     return(min <= city.population.citizens.Count && city.population.citizens.Count <= max);
 }
예제 #5
0
 //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);
예제 #6
0
 public override bool IsAllowed(QOLCity city, Pawn p)
 {
     return(!filter.IsAllowed(city, p));
 }
예제 #7
0
 public override bool IsAllowed(QOLCity city, Pawn p)
 {
     return(p.RaceProps.IsFlesh);
 }
예제 #8
0
 abstract public bool IsAllowed(QOLCity city, Pawn p);
예제 #9
0
 abstract public void CityContribution(QOLCity city, Dictionary <QOLCityNeedDef, NumericAdjustment> needContribution, Dictionary <QOLCityNeedDef, NumericAdjustment> needRequirements, Dictionary <QOLSocietyIndicatorDef, NumericAdjustment> indicatorContribution);
예제 #10
0
 override public bool IsAllowed(QOLCity city, Pawn p)
 {
     return(p != null && p.RaceProps != null && p.RaceProps.Animal);
 }
예제 #11
0
 override public bool IsAllowed(QOLCity city, Pawn p)
 {
     return(p != null && p.RaceProps != null && p.RaceProps.Humanlike);
 }
예제 #12
0
 public bool IsImmigrationAllowed(QOLCity city, Pawn p)
 {
     return(!immigrationLaws.Any(il => !il.IsAllowed(city, p)));
 }