public FoxService()
 {
     DefaultFox = new Fox();
     foxes      = new List <Fox>()
     {
         DefaultFox
     };
 }
        public bool AddFox(string name)
        {
            bool nameExists = false;

            foreach (var foxx in Foxes)
            {
                if (foxx.Name == name)
                {
                    nameExists = true;
                    return(nameExists);
                }
            }
            ListOfTricks = new List <string>();
            Fox fox = new Fox(name, ListOfTricks, "salad", "water");

            Foxes.Add(fox);
            return(nameExists);
        }
Beispiel #3
0
 public Fox GetFoxByName(string name)
 {
     CurrentFox = ListOfFoxes.Find(fox => fox.Name.Equals(name));
     return(CurrentFox);
 }
Beispiel #4
0
 public void AddFoxToDatabase(Fox fox)
 {
     ListOfFoxes.Add(fox);
 }
 public void ChangeNutrition(string name, string food, string drink)
 {
     currentFox       = FindFox(name);
     currentFox.Food  = food;
     currentFox.Drink = drink;
 }