Exemple #1
0
        //Feeds the pet a Foodtype
        public void FeedPet(Pet pet, FoodType foodToEat)
        {
            //feed the pet food
            int gainedNuts = pet.food.Eat(foodToEat);

            string text = "";

            if (gainedNuts > 0)
            {
                text = String.Format("{0} just ate {1}, ",
                                        pet.name,
                                        foodToEat.ToString().ToLower());
            }
            //print the
            text = text + "{0} satiation level is: {1}\n";
            string formatted = String.Format(text,
                                            pet.pronoun,
                                            pet.food.satiation);
            Tools.Print(newFG: Program.defaultFG,
                        text: formatted,
                        newBG: ConsoleColor.DarkGreen);

            //vals: new object[] {pet.name, foodToEat, pet.food.satiation});
        }
Exemple #2
0
        public int Eat(FoodType toBeEaten)
        {
            int gainedNutrients= toBeEaten.EatThis();
            this.satiation += gainedNutrients;

            if (satiation >= 150)
            {

                Tools.Print(newBG: ConsoleColor.Red, text: "Mother f****r is full yo, stop feeding it.\n");

            }

            return gainedNutrients;
        }