Exemple #1
0
        static void Main(string[] args)
        {
            Bee bee1 = new Bee("John", 3.2f);
            Bee bee2 = new Bee("Paul", 2.7f);
            Bee bee3 = new Bee("George", 1.1f);
            Bee bee4 = new Bee("Ringo", 2.0f);
            Bee bee5 = new Bee("Kurt", 2.3f);
            Bee bee6 = new Bee("Dave", 7.4f);
            Bee bee7 = new Bee("Krist", 1.5f);


            BeeList bees1 = new BeeList();

            bees1.AddBee(bee1);
            bees1.AddBee(bee2);
            bees1.AddBee(bee3);
            bees1.AddBee(bee4);
            BeeList bees2 = new BeeList();

            bees2.AddBee(bee5);
            bees2.AddBee(bee6);
            bees2.AddBee(bee7);

            System.Console.WriteLine(bees2);
        }
        static void Main(string[] args)
        {
            Bee Bee1 = new Bee("John", 3.2f);
            Bee Bee2 = new Bee("Paul", 2.7f);
            Bee Bee3 = new Bee("George", 1.1f);
            Bee Bee4 = new Bee("Ringo", 2.0f);
            Bee Bee5 = new Bee("Kurt", 2.3f);
            Bee Bee6 = new Bee("Dave", 7.4f);
            Bee Bee7 = new Bee("Krist", 1.5f);

            BeeHive BeeHive1 = new BeeHive(1, 4);

            BeeHive1.AddBee(Bee1);
            BeeHive1.AddBee(Bee2);
            BeeHive1.AddBee(Bee3);
            BeeHive1.AddBee(Bee4);

            BeeHive BeeHive2 = new BeeHive(2, 3);

            BeeHive2.AddBee(Bee5);
            BeeHive2.AddBee(Bee6);
            BeeHive2.AddBee(Bee7);

            BeeHive1.PrintList();
            BeeHive1.CollectHoney(10);

            BeeHive2.PrintList();
            BeeHive2.CollectHoney(0);
        }
 //methods
 public void AddBee(Bee newBee)
 {
     this.BeesList.Add(newBee);
 }
Exemple #4
0
 public void AddBee(Bee newBee)
 {
     this.beeList.Add(newBee);
 }