Beispiel #1
0
        // Override Method

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

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

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

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