Beispiel #1
0
        public void RemoveSpecies(string species)
        {
            List <Rabbit> result = Rabbits.Where(x => x.Species != species).ToList();

            Count -= result.Count;

            Rabbits = result;
        }
Beispiel #2
0
        public Rabbit[] SellRabbitsBySpecies(string species)
        {
            foreach (var rabbit in Rabbits)
            {
                if (rabbit.Species == species)
                {
                    rabbit.Available = false;

                    Count--;
                }
            }

            return(Rabbits.Where(x => x.Species == species).ToArray());
        }