Exemple #1
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");
            }
        }
Exemple #2
0
 public void AcceptBee(Bee bee)
 {
     Console.WriteLine("Bee accepted");
     bee.MyHive = this;
     beeList.Add(bee);
 }