コード例 #1
0
        public Bee(int num, Random rGen, BeeHive hive)
        {
            this.Number = num;
            this.rGen = rGen;
            this.hive = hive;
            this.position = hive.Entry;

            this.state = (State)((int)rGen.Next(0, 2));
            this.Appetite = (int)rGen.Next(10, 50);
        }
コード例 #2
0
 private void createBees_Click(object sender, EventArgs e)
 {
     if(numberBees.Text == "")
     {
         MessageBox.Show("Enter valid input");
     }
     else
     {
         hive = new BeeHive(Int32.Parse(numberBees.Text), 80 * Int32.Parse(numberBees.Text), new Point(0, 0), this.env, this);
         updateBeeList();
         this.hivePanel.Visible = true;
         this.Size = new Size(428, 595);
         //this.Invalidate();
         hive.go();
         timer1.Enabled = true;
     }
 }