Ejemplo n.º 1
0
 public void AcceptBee(Bee bee)
 {
     Console.WriteLine("Bee accepted");
     bee.MyHive = this;
     WorkStart += bee.DoJob;
     beeList.Add(bee);
 }
Ejemplo n.º 2
0
        private void ProduceBee()
        {
            if (MyHive == null || CurrentSeason != Seasons.Summer)
            {
                return;
            }
            Random random       = new Random();
            int    numOfNewBees = 2;

            for (int i = 0; i < numOfNewBees; i++)
            {
                Bee newBee = random.Next(15) > 13 ? (Bee) new Drone(MyHive) : new Worker(MyHive);
                MyHive.AcceptBee(newBee);
                Console.WriteLine("A bee has been created");
            }
        }