private void MoveUnit(UnitControl unit, HexLabel hex) { int x = hex.Location.X + ((hex.Width - unit.Width) / 2); int y = hex.Location.Y + ((hex.Height - unit.Height) / 2); unit.Location = new Point(x, y); }
private void AddHexLabel(Hex hex, int x, int y) { HexLabel hexLabel = new HexLabel(hex); hexLabel.Click += this.HexLabel_Click; this.pnlField.Controls.Add(hexLabel); hexLabel.Location = new Point(x, y); this.hexLabels.Add(hex, hexLabel); }
private void HexLabel_Click(object sender, EventArgs e) { HexLabel hexLabel = (HexLabel)sender; this.game.OnSelectHex(hexLabel.Hex); }