예제 #1
0
 public World(Bee.BeeMessage messageSender)
 {
     Bees = new List<Bee>();
     Flowers = new List<Flower>();
     Random random = new Random();
     for (int i = 0; i < 10; i++)
         AddFlower(random);
     Hive = new Hive(this, messageSender);
 }
예제 #2
0
 public Hive(World world, Bee.BeeMessage messageSender)
 {
     MessageSender = messageSender;
     Honey = INITIAL_HONEY;
     InitializeLocations();
     _world = world;
     Random random = new Random();
     for (int i = 0; i < INITIAL_BEES; i++)
         AddBee(random);
 }
예제 #3
0
        private void AddBee(Random random)
        {
            _beeCount++;
            int r1 = random.Next(100) - 50;
            int r2 = random.Next(100) - 50;
            Point startPoint = new Point(_locations["Nursery"].X + r1,
                _locations["Nursery"].Y + r2);

            Bee newBee = new Bee(_beeCount, startPoint, this, _world);
            newBee.MessageSender += MessageSender;
            _world.Bees.Add(newBee);
        }