Exemplo n.º 1
0
 public bool TargetAllowed(IIncidentTarget target)
 {
     return(this.targetTypes.Intersect(target.AcceptedTypes()).Any <IncidentTargetTypeDef>());
 }
Exemplo n.º 2
0
 public IEnumerable <FiringIncident> MakeIncidentsForInterval(StorytellerComp comp, List <IIncidentTarget> targets)
 {
     if (GenDate.DaysPassedFloat <= comp.props.minDaysPassed)
     {
         yield break;
     }
     for (int i = 0; i < targets.Count; i++)
     {
         IIncidentTarget targ = targets[i];
         if (comp.props.allowedTargetTypes == null || comp.props.allowedTargetTypes.Count == 0 || comp.props.allowedTargetTypes.Intersect(targ.AcceptedTypes()).Any <IncidentTargetTypeDef>())
         {
             foreach (FiringIncident fi in comp.MakeIntervalIncidents(targ))
             {
                 if (Find.Storyteller.difficulty.allowBigThreats || (fi.def.category != IncidentCategoryDefOf.ThreatBig && fi.def.category != IncidentCategoryDefOf.RaidBeacon))
                 {
                     yield return(fi);
                 }
             }
         }
     }
     yield break;
 }
Exemplo n.º 3
0
        public IEnumerable <FiringIncident> MakeIncidentsForInterval()
        {
            List <IIncidentTarget> targets = this.AllIncidentTargets;

            for (int i = 0; i < this.storytellerComps.Count; i++)
            {
                StorytellerComp c = this.storytellerComps[i];
                if (GenDate.DaysPassedFloat > c.props.minDaysPassed)
                {
                    for (int j = 0; j < targets.Count; j++)
                    {
                        IIncidentTarget targ = targets[j];
                        if (c.props.allowedTargetTypes == null || c.props.allowedTargetTypes.Count == 0 || c.props.allowedTargetTypes.Intersect(targ.AcceptedTypes()).Any <IncidentTargetTypeDef>())
                        {
                            foreach (FiringIncident fi in c.MakeIntervalIncidents(targ))
                            {
                                if (Find.Storyteller.difficulty.allowBigThreats || (fi.def.category != IncidentCategory.ThreatBig && fi.def.category != IncidentCategory.RaidBeacon))
                                {
                                    yield return(fi);
                                }
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 4
0
        public IEnumerable <FiringIncident> MakeIncidentsForInterval()
        {
            List <IIncidentTarget> targets = this.AllIncidentTargets;

            for (int j = 0; j < this.storytellerComps.Count; j++)
            {
                StorytellerComp c = this.storytellerComps[j];
                if (!(GenDate.DaysPassedFloat <= c.props.minDaysPassed))
                {
                    for (int i = 0; i < targets.Count; i++)
                    {
                        IIncidentTarget targ = targets[i];
                        if (c.props.allowedTargetTypes == null || c.props.allowedTargetTypes.Count == 0 || c.props.allowedTargetTypes.Intersect(targ.AcceptedTypes()).Any())
                        {
                            foreach (FiringIncident item in c.MakeIntervalIncidents(targ))
                            {
                                if (!Find.Storyteller.difficulty.allowBigThreats && (item.def.category == IncidentCategory.ThreatBig || item.def.category == IncidentCategory.RaidBeacon))
                                {
                                    continue;
                                }
                                yield return(item);

                                /*Error: Unable to find new state assignment for yield return*/;
                            }
                        }
                    }
                }
            }
            yield break;
IL_0226:
            /*Error near IL_0227: Unexpected return in MoveNext()*/;
        }