Exemplo n.º 1
0
        public IEnumerable <string> ConfigErrors()
        {
            if (soundMeleeHitPawn == null)
            {
                yield return("soundMeleeHitPawn is null");

                /*Error: Unable to find new state assignment for yield return*/;
            }
            if (soundMeleeHitBuilding == null)
            {
                yield return("soundMeleeHitBuilding is null");

                /*Error: Unable to find new state assignment for yield return*/;
            }
            if (soundMeleeMiss == null)
            {
                yield return("soundMeleeMiss is null");

                /*Error: Unable to find new state assignment for yield return*/;
            }
            if (predator && !Eats(FoodTypeFlags.Meat))
            {
                yield return("predator but doesn't eat meat");

                /*Error: Unable to find new state assignment for yield return*/;
            }
            for (int j = 0; j < lifeStageAges.Count; j++)
            {
                for (int i = 0; i < j; i++)
                {
                    if (lifeStageAges[i].minAge > lifeStageAges[j].minAge)
                    {
                        yield return("lifeStages minAges are not in ascending order");

                        /*Error: Unable to find new state assignment for yield return*/;
                    }
                }
            }
            if (litterSizeCurve != null)
            {
                using (IEnumerator <string> enumerator = litterSizeCurve.ConfigErrors("litterSizeCurve").GetEnumerator())
                {
                    if (enumerator.MoveNext())
                    {
                        string e = enumerator.Current;
                        yield return(e);

                        /*Error: Unable to find new state assignment for yield return*/;
                    }
                }
            }
            if (nameOnTameChance > 0f && nameGenerator == null)
            {
                yield return("can be named, but has no nameGenerator");

                /*Error: Unable to find new state assignment for yield return*/;
            }
            if (Animal && wildness < 0f)
            {
                yield return("is animal but wildness is not defined");

                /*Error: Unable to find new state assignment for yield return*/;
            }
            if (useMeatFrom != null && useMeatFrom.category != ThingCategory.Pawn)
            {
                yield return("tries to use meat from non-pawn " + useMeatFrom);

                /*Error: Unable to find new state assignment for yield return*/;
            }
            if (useMeatFrom != null && useMeatFrom.race.useMeatFrom != null)
            {
                yield return("tries to use meat from " + useMeatFrom + " which uses meat from " + useMeatFrom.race.useMeatFrom);

                /*Error: Unable to find new state assignment for yield return*/;
            }
            if (useLeatherFrom != null && useLeatherFrom.category != ThingCategory.Pawn)
            {
                yield return("tries to use leather from non-pawn " + useLeatherFrom);

                /*Error: Unable to find new state assignment for yield return*/;
            }
            if (useLeatherFrom != null && useLeatherFrom.race.useLeatherFrom != null)
            {
                yield return("tries to use leather from " + useLeatherFrom + " which uses leather from " + useLeatherFrom.race.useLeatherFrom);

                /*Error: Unable to find new state assignment for yield return*/;
            }
            if (Animal && trainability == null)
            {
                yield return("animal has trainability = null");

                /*Error: Unable to find new state assignment for yield return*/;
            }
            yield break;
IL_050a:
            /*Error near IL_050b: Unexpected return in MoveNext()*/;
        }
Exemplo n.º 2
0
 public IEnumerable <string> ConfigErrors()
 {
     if (soundMeleeHitPawn == null)
     {
         yield return("soundMeleeHitPawn is null");
     }
     if (soundMeleeHitBuilding == null)
     {
         yield return("soundMeleeHitBuilding is null");
     }
     if (soundMeleeMiss == null)
     {
         yield return("soundMeleeMiss is null");
     }
     if (predator && !Eats(FoodTypeFlags.Meat))
     {
         yield return("predator but doesn't eat meat");
     }
     for (int j = 0; j < lifeStageAges.Count; j++)
     {
         for (int i = 0; i < j; i++)
         {
             if (lifeStageAges[i].minAge > lifeStageAges[j].minAge)
             {
                 yield return("lifeStages minAges are not in ascending order");
             }
         }
     }
     if (litterSizeCurve != null)
     {
         foreach (string item in litterSizeCurve.ConfigErrors("litterSizeCurve"))
         {
             yield return(item);
         }
     }
     if (nameOnTameChance > 0f && nameGenerator == null)
     {
         yield return("can be named, but has no nameGenerator");
     }
     if (Animal && wildness < 0f)
     {
         yield return("is animal but wildness is not defined");
     }
     if (useMeatFrom != null && useMeatFrom.category != ThingCategory.Pawn)
     {
         yield return("tries to use meat from non-pawn " + useMeatFrom);
     }
     if (useMeatFrom != null && useMeatFrom.race.useMeatFrom != null)
     {
         yield return("tries to use meat from " + useMeatFrom + " which uses meat from " + useMeatFrom.race.useMeatFrom);
     }
     if (useLeatherFrom != null && useLeatherFrom.category != ThingCategory.Pawn)
     {
         yield return("tries to use leather from non-pawn " + useLeatherFrom);
     }
     if (useLeatherFrom != null && useLeatherFrom.race.useLeatherFrom != null)
     {
         yield return("tries to use leather from " + useLeatherFrom + " which uses leather from " + useLeatherFrom.race.useLeatherFrom);
     }
     if (Animal && trainability == null)
     {
         yield return("animal has trainability = null");
     }
 }