Exemple #1
0
        static void Main(string[] args)
        {
            Cage        cage   = new Cage("Wildness", 20);
            RabbitStore rabbit = new RabbitStore("Fluffy", "Blanc de Hotot");

            Console.WriteLine(rabbit);
        }
Exemple #2
0
 public void Add(RabbitStore rabbit)
 {
     if (this.data.Count + 1 < -this.Capacity)
     {
         data.Add(rabbit);
     }
 }
Exemple #3
0
        public RabbitStore SellRabbit(string name)
        {
            RabbitStore rabbit = this.data
                                 .FirstOrDefault(n => n.Name == name);

            if (rabbit != null)
            {
                rabbit.Available = false;
            }
            return(rabbit);
        }
Exemple #4
0
        public bool RemoveRabbit(string name)
        {
            RabbitStore rabbit = this.data
                                 .FirstOrDefault(n => n.Name == name);

            if (rabbit != null)
            {
                this.data.Remove(rabbit);
                return(true);
            }
            return(false);
        }