public GameForm(int mapSize) { formatting = new Formatting(this); FirstLevel = new MapTest(this, mapSize, path); InitializeComponent(); SQL.StartStopwatch(); }
private void ResetButtonClick(object sender, MouseEventArgs e) { foreach (HexagonButton hex in MapTest.hexMap) { hex.Visited = false; hex.Passable = true; hex.Enabled = true; hex.BackColor = System.Drawing.Color.LightGray; PlaceHexagonButton(hex); } MapTest.ResetMouse(); }
private void ResetButtonClick(object sender, MouseEventArgs e) { foreach (HexagonButton hex in MapTest.hexMap) { hex.Visited = false; hex.Passable = true; hex.Enabled = true; PlaceHexagonButton(hex); } MapTest.ResetMouse(); SQL.ResetGameToList(); }
/// <summary> /// Initialises and draws a hexagon button, /// and adds a click event calculates a new route when an HexButton is clicked. /// </summary> /// <param name="button"></param> /// <param name="map"></param> public void DrawButton(HexagonButton button, MapTest map) { button.Size = new Size((int)(ConvertPointToPixel(formatting.ButtonHeight)), (int)(ConvertPointToPixel(formatting.ButtonWidth))); button.TabStop = false; button.FlatStyle = FlatStyle.Flat; button.FlatAppearance.BorderSize = 0; button.BackColor = Color.LightGray; button.Paint += ButtonPainter; button.MouseClick += button.HexClicked; button.MouseClick += HexClickedColor; button.MouseClick += map.MousePositioner; gamePanel.Controls.Add(button); }