Beispiel #1
0
        private void RoadGen(Form1 form, Hexagon[] Grid, int loc, int hexRef, int x, int y)
        {
            ButtonInfo thisBtn = new ButtonInfo(form, Grid, Background, this, place, true, roadCnt, hexRef, loc);

            Buttons.Add(thisBtn);

            Point  newLoc = new Point(Background[hexRef].Location.X + x, Background[hexRef].Location.Y + y);
            Button b      = new Button();

            b.Size      = new Size(btnSize, btnSize);
            b.Location  = newLoc;
            b.BackColor = btnColor;
            b.Tag       = townCnt + roadCnt;
            b.Name      = "roadBtn, " + roadCnt.ToString();
            b.Click    += new EventHandler(this.btnHandeler);
            roadBtns.Add(b);
            form.Controls.Add(roadBtns[roadCnt]);
            roadBtns[roadCnt].BringToFront();
            roadCnt++;
        }
Beispiel #2
0
        private void HouseGen(Form1 form, Hexagon[] Grid, int loc, int hexRef, int x, int y)
        {
            ButtonInfo thisBtn = new ButtonInfo(form, Grid, Background, this, place, false, townCnt, hexRef, loc);

            Buttons.Add(thisBtn);

            Point  newLoc = new Point(Background[hexRef].Location.X + x, Background[hexRef].Location.Y + y);
            Button b      = new Button();

            b.Height    = btnSize;
            b.Width     = btnSize;
            b.Location  = newLoc;
            b.BackColor = btnColor;
            b.Tag       = townCnt + roadCnt;
            b.Name      = "houseBtn" + townCnt.ToString();
            newLoc.Offset(0, b.Height + 5);
            b.Click += new EventHandler(this.btnHandeler);
            townBtns.Add(b);
            form.Controls.Add(townBtns[townCnt]);
            townBtns[townCnt].BringToFront();
            townCnt++;
        }