Esempio n. 1
0
        // Override Method

        public override string Feed(VirtualPet x)
        {
            x.Hunger -= 5;
            x.Thirst += 2;
            return(x.Name + " has been fed.");
        }
Esempio n. 2
0
        // Override Method

        public override string Play(VirtualPet x)
        {
            x.Boredom -= 4;
            return("Ok, you played with " + x.Name + ".");
        }
Esempio n. 3
0
        // Methods

        public string GiveWater(VirtualPet x)
        {
            x.Thirst -= 5;
            return(x.Name + " has been given water.");
        }
Esempio n. 4
0
        // Methods

        public string Adopt(List <VirtualPet> pets, VirtualPet x)
        {
            pets.Remove(x);
            return("Ok, you adopted " + x.Name + ".");
        }