コード例 #1
0
        public void CreateFromIncubator(StardewValley.AnimalHouse animalHouse, string name)
        {
            Incubator incubator;

            try
            {
                incubator = new Incubator(animalHouse);
            }
            catch
            {
                // Could not find an incubator; do nothing.
                return;
            }

            List <string> types = this.DetermineHatchlingTypes(incubator);

            // Remove types that should not be here
            types = this.Sanitize(types);

            // Create the animal if we could pull the type
            this.CreateRandomBaby(name, types, animalHouse);

            // Reset the incubator regardless if a baby was hatched or not
            incubator.ResetIncubatingItem();
        }