public static Dictionary <Hex, List <SortPoint> > GetHexToPointsDictionary(FractionalHex[] allPositions) { int pointCount = allPositions.Length; var cellPoints = new Dictionary <Hex, List <SortPoint> >(pointCount); for (int i = 0; i < pointCount; i++) { var currPos = allPositions[i]; var currSortPoint = new SortPoint(i, currPos); var currHex = currPos.Round(); List <SortPoint> pointsOfHex; if (cellPoints.TryGetValue(currHex, out pointsOfHex)) { pointsOfHex.Add(currSortPoint); cellPoints[currHex] = pointsOfHex; } else { pointsOfHex = new List <SortPoint>() { currSortPoint }; cellPoints.Add(currHex, pointsOfHex); } } return(cellPoints); }
void EditLabel(int check) { if (check == 0) { label1.Hide(); label2.Hide(); label3.Hide(); label4.Hide(); label5.Hide(); textBox2.Hide(); textBox3.Hide(); textBox4.Hide(); textBox5.Hide(); textBox6.Hide(); button6.Hide(); DeleteBtn.Hide(); SearchBtn.Hide(); SortName.Hide(); SortGroup.Hide(); SortPoint.Hide(); } if (check == 1) { label1.Show(); label2.Show(); label3.Show(); label4.Show(); label5.Show(); textBox2.Show(); textBox3.Show(); textBox4.Show(); textBox5.Show(); textBox6.Show(); button6.Show(); DeleteBtn.Hide(); SortName.Hide(); SortGroup.Hide(); SortPoint.Hide(); } if (check == 2) { DeleteBtn.Show(); label1.Show(); label2.Hide(); label3.Hide(); label4.Hide(); label5.Hide(); textBox2.Show(); textBox3.Hide(); textBox4.Hide(); textBox5.Hide(); textBox6.Hide(); button6.Hide(); SearchBtn.Hide(); SortName.Hide(); SortGroup.Hide(); SortPoint.Hide(); } if (check == 3) { SearchBtn.Show(); label1.Show(); label2.Hide(); label3.Hide(); label4.Hide(); label5.Hide(); textBox2.Show(); textBox3.Hide(); textBox4.Hide(); textBox5.Hide(); textBox6.Hide(); button6.Hide(); DeleteBtn.Hide(); SortName.Hide(); SortGroup.Hide(); SortPoint.Hide(); } if (check == 4) { SearchBtn.Hide(); label1.Hide(); label2.Hide(); label3.Hide(); label4.Hide(); label5.Hide(); textBox2.Hide(); textBox3.Hide(); textBox4.Hide(); textBox5.Hide(); textBox6.Hide(); button6.Hide(); DeleteBtn.Hide(); SortName.Show(); SortGroup.Show(); SortPoint.Show(); } }