private void clickMouse(object sender, MouseEventArgs e) { TypeChart6.GetCoordinate((PictureBox)sender, e, out int X, out int Y); int index = Y * TypeCount + X; chart[index] = TypeChart6.ToggleEffectiveness(chart[index], e.Button == MouseButtons.Left); updateLabel(X, Y, chart[index]); populateChart(); }
private void ClickMouse(object sender, MouseEventArgs e) { TypeChart6.GetCoordinate((PictureBox)sender, e, out int X, out int Y); int index = (Y * TypeCount) + X; if (index >= chart.Length) { return; } chart[index] = TypeChart6.ToggleEffectiveness(chart[index], e.Button == MouseButtons.Left); UpdateLabel(X, Y, chart[index]); PopulateChart(); }