StartNewBreedCycle() public method

Start a new breeding cycle of the given species.
public StartNewBreedCycle ( ThingDef breedingSpeciesDef ) : void
breedingSpeciesDef ThingDef
return void
Example #1
0
        public override void Notify_IterationCompleted(Pawn billDoer, List <Thing> ingredients)
        {
            base.Notify_IterationCompleted(billDoer, ingredients);

            Building_AquacultureBasin aquacultureBasin = this.billStack.billGiver as Building_AquacultureBasin;

            if (aquacultureBasin != null)
            {
                // Get the supplied species def and start a new breed cycle in the aquaculture basin.
                ThingDef speciesSuppliedDef = this.recipe.products.First().thingDef;
                aquacultureBasin.StartNewBreedCycle(speciesSuppliedDef);
            }
        }
        public override void Notify_IterationCompleted(Pawn billDoer, List <Thing> ingredients)
        {
            base.Notify_IterationCompleted(billDoer, ingredients);

            Building_AquacultureBasin aquacultureBasin = this.billStack.billGiver as Building_AquacultureBasin;

            if (aquacultureBasin != null)
            {
                // Get the supplied species def and start a new breed cycle in the aquaculture basin.
                Thing fishCorpse = ingredients.First();
                if (fishCorpse != null)
                {
                    PawnKindDef fishKind           = null;
                    string      fishCorpseAsString = fishCorpse.ToString();
                    if (fishCorpseAsString.Contains("Mashgon"))
                    {
                        fishKind = Util_FishIndustry.MashgonDef;
                    }
                    else if (fishCorpseAsString.Contains("Blueblade"))
                    {
                        fishKind = Util_FishIndustry.BluebladeDef;
                    }
                    else if (fishCorpseAsString.Contains("Tailteeth"))
                    {
                        fishKind = Util_FishIndustry.TailteethDef;
                    }
                    if (fishKind != null)
                    {
                        aquacultureBasin.StartNewBreedCycle(fishKind);
                    }
                    else
                    {
                        Log.Warning("FishIndustry: this fish is not handled for breeding (" + fishCorpseAsString + ").");
                    }
                }
            }
        }