示例#1
0
        public void AcceptBee(Bee bee)
        {
            Console.WriteLine("Bee accepted");

            bee.MyHive = this;
            WorkStart += (sender, e) => {
                bee.DoJob(e.Danger);
            };
            //WorkStart += bee.DoJob;
            beeList.Add(bee);
        }
示例#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");
            }
        }