private void GenerateButton_Click(object sender, EventArgs e) { Team1.Clear(); Team2.Clear(); Team3.Clear(); Team4.Clear(); Team5.Clear(); Team6.Clear(); Team7.Clear(); Team8.Clear(); Team9.Clear(); Team10.Clear(); Team11.Clear(); Team12.Clear(); Team13.Clear(); Team14.Clear(); int teamSize = GetTeamSize(); int totalTeams; if (teamSize == 4) { totalTeams = 7; vsLabel.Visible = false; usaLabel.Visible = false; europeLabel.Visible = false; Team8.Visible = false; Team9.Visible = false; Team10.Visible = false; Team11.Visible = false; Team12.Visible = false; Team13.Visible = false; Team14.Visible = false; SendItPictureBox.Visible = true; DalyBox.Visible = true; } else { totalTeams = 14; vsLabel.Visible = true; usaLabel.Visible = true; europeLabel.Visible = true; Team8.Visible = true; Team9.Visible = true; Team10.Visible = true; Team11.Visible = true; Team12.Visible = true; Team13.Visible = true; Team14.Visible = true; SendItPictureBox.Visible = false; DalyBox.Visible = false; } string[] All = { "Brian Kelly ", "Lucas Bogard ", "Drew Taylor ", "Jordan Popa", "Ryan Popa", "Dan Kellogg", "Brent Whitten", "Buddy Sheffer", "Vikash Pillay", "Jake Desrochers", "Brad Smith", "Eddie Nickerson", "Connor Dixon", "Eric Gordon", "Jake Miller", "Jake Townsend", "James Strabel", "Jordan Rife", "Kevin Bartosek", "Mike Harmeson", "Brad Fite", "Drew Nichols", "Billy Auxier", "Cam Corteggiano", "Chad Bigger", "Justin Rife", "Nick Carlson", "Troy Kierczynski" }; int[] Rankings = { 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }; string[] OnesArray = { "Brian Kelly", "Lucas Bogard", "Drew Taylor" }; string[] TwosArray = { "Jordan Popa", "Ryan Popa", "Dan Kellogg", "Brent Whitten", "Buddy Sheffer", "Vikash Pillay", "Jake Desrochers", "Brad Smith", "Connor Dixon" }; string[] ThreesArray = { "Eddie Nickerson", "Eric Gordon", "Jake Miller", "Jake Townsend", "James Strabel", "Jordan Rife", "Kevin Bartosek", "Mike Harmeson", "Brad Fite" }; string[] FoursArray = { "Drew Nichols", "Billy Auxier", "Cam Corteggiano", "Chad Bigger", "Justin Rife", "Nick Carlson", "Troy Kierczynski" }; ArrayList Players = new ArrayList(); ArrayList Ranks = new ArrayList(); ArrayList Ones = new ArrayList(); ArrayList Twos = new ArrayList(); ArrayList Threes = new ArrayList(); ArrayList Fours = new ArrayList(); Players.AddRange(All); Ranks.AddRange(Rankings); Ones.AddRange(OnesArray); Twos.AddRange(TwosArray); Threes.AddRange(ThreesArray); Fours.AddRange(FoursArray); for (int y = 1; y <= totalTeams; y++) { ArrayList Team = new ArrayList(); int Sum = 0; //for (int x = 0; x < teamSize; x++) //{ int playerNumber; if (teamSize == 4) { if (y <= 2) { playerNumber = GetNumber(Ones.Count); Team.Add(Ones[playerNumber]); Ones.Remove(Ones[playerNumber]); playerNumber = GetNumber(Threes.Count); Team.Add(Threes[playerNumber]); Threes.Remove(Threes[playerNumber]); playerNumber = GetNumber(Threes.Count); Team.Add(Threes[playerNumber]); Threes.Remove(Threes[playerNumber]); playerNumber = GetNumber(Fours.Count); Team.Add(Fours[playerNumber]); Fours.Remove(Fours[playerNumber]); } if (y == 3) { playerNumber = GetNumber(Ones.Count); Team.Add(Ones[playerNumber]); Ones.Remove(Ones[playerNumber]); playerNumber = GetNumber(Twos.Count); Team.Add(Twos[playerNumber]); Twos.Remove(Twos[playerNumber]); playerNumber = GetNumber(Threes.Count); Team.Add(Threes[playerNumber]); Threes.Remove(Threes[playerNumber]); playerNumber = GetNumber(Fours.Count); Team.Add(Fours[playerNumber]); Fours.Remove(Fours[playerNumber]); } if (y > 3) { playerNumber = GetNumber(Twos.Count); Team.Add(Twos[playerNumber]); Twos.Remove(Twos[playerNumber]); playerNumber = GetNumber(Twos.Count); Team.Add(Twos[playerNumber]); Twos.Remove(Twos[playerNumber]); playerNumber = GetNumber(Threes.Count); Team.Add(Threes[playerNumber]); Threes.Remove(Threes[playerNumber]); playerNumber = GetNumber(Fours.Count); Team.Add(Fours[playerNumber]); Fours.Remove(Fours[playerNumber]); } if (y == 1) { foreach (string s in Team) { Team1.AppendText(s); Team1.AppendText("\r\n"); //Team1Sum.Text = Sum.ToString(); } } if (y == 2) { foreach (string s in Team) { Team2.AppendText(s); Team2.AppendText("\r\n"); // Team2Sum.Text = Sum.ToString(); } } if (y == 3) { foreach (string s in Team) { Team3.AppendText(s); Team3.AppendText("\r\n"); // Team3Sum.Text = Sum.ToString(); } } if (y == 4) { foreach (string s in Team) { Team4.AppendText(s); Team4.AppendText("\r\n"); // Team4Sum.Text = Sum.ToString(); } } if (y == 5) { foreach (string s in Team) { Team5.AppendText(s); Team5.AppendText("\r\n"); //Team5Sum.Text = Sum.ToString(); } } if (y == 6) { foreach (string s in Team) { Team6.AppendText(s); Team6.AppendText("\r\n"); //Team6Sum.Text = Sum.ToString(); } } if (y == 7) { foreach (string s in Team) { Team7.AppendText(s); Team7.AppendText("\r\n"); //Team7Sum.Text = Sum.ToString(); } } } else { if (Ones.Count > 0) { if (Ones.Count == 3) { Team.Add("Brian Kelly"); Team.Add("Cam Corteggiano"); int findBron = Ones.IndexOf("Brian Kelly"); int findCam = Fours.IndexOf("Cam Corteggiano"); Ones.Remove(Ones[findBron]); Fours.Remove(Fours[findCam]); } else { playerNumber = GetNumber(Ones.Count); Team.Add(Ones[playerNumber]); Team.Add(Fours[playerNumber]); Fours.Remove(Fours[playerNumber]); Ones.Remove(Ones[playerNumber]); } } else if (Fours.Count > 0) { playerNumber = GetNumber(Twos.Count); Team.Add(Twos[playerNumber]); Twos.Remove(Twos[playerNumber]); playerNumber = GetNumber(Fours.Count); Team.Add(Fours[playerNumber]); Fours.Remove(Fours[playerNumber]); } else if (Twos.Count > 0) { playerNumber = GetNumber(Twos.Count); Team.Add(Twos[playerNumber]); Twos.Remove(Twos[playerNumber]); playerNumber = GetNumber(Threes.Count); Team.Add(Threes[playerNumber]); Threes.Remove(Threes[playerNumber]); } else { playerNumber = GetNumber(Threes.Count); Team.Add(Threes[playerNumber]); Threes.Remove(Threes[playerNumber]); playerNumber = GetNumber(Threes.Count); Team.Add(Threes[playerNumber]); Threes.Remove(Threes[playerNumber]); } if (y == 1) { foreach (string s in Team) { Team1.AppendText(s); Team1.AppendText("\r\n"); //Team1Sum.Text = Sum.ToString(); } } if (y == 2) { foreach (string s in Team) { Team8.AppendText(s); Team8.AppendText("\r\n"); // Team2Sum.Text = Sum.ToString(); } } if (y == 3) { foreach (string s in Team) { Team2.AppendText(s); Team2.AppendText("\r\n"); // Team3Sum.Text = Sum.ToString(); } } if (y == 4) { foreach (string s in Team) { Team9.AppendText(s); Team9.AppendText("\r\n"); // Team4Sum.Text = Sum.ToString(); } } if (y == 5) { foreach (string s in Team) { Team3.AppendText(s); Team3.AppendText("\r\n"); //Team5Sum.Text = Sum.ToString(); } } if (y == 6) { foreach (string s in Team) { Team10.AppendText(s); Team10.AppendText("\r\n"); //Team6Sum.Text = Sum.ToString(); } } if (y == 7) { foreach (string s in Team) { Team4.AppendText(s); Team4.AppendText("\r\n"); //Team7Sum.Text = Sum.ToString(); } } if (y == 8) { foreach (string s in Team) { Team11.AppendText(s); Team11.AppendText("\r\n"); } } if (y == 9) { foreach (string s in Team) { Team5.AppendText(s); Team5.AppendText("\r\n"); } } if (y == 10) { foreach (string s in Team) { Team12.AppendText(s); Team12.AppendText("\r\n"); } } if (y == 11) { foreach (string s in Team) { Team6.AppendText(s); Team6.AppendText("\r\n"); } } if (y == 12) { foreach (string s in Team) { Team13.AppendText(s); Team13.AppendText("\r\n"); } } if (y == 13) { foreach (string s in Team) { Team7.AppendText(s); Team7.AppendText("\r\n"); } } if (y == 14) { foreach (string s in Team) { Team14.AppendText(s); Team14.AppendText("\r\n"); } } } //if(Ones.Contains(Players[playerNumber])) //{ // Team.Add(Players[playerNumber]); // Sum = Sum + (int)Ranks[playerNumber]; // Players.Remove(Players[playerNumber].ToString()); // Ranks.Remove(Ranks[playerNumber]); // Ones.Remove(Ones[playerNumber].ToString()); //} //Team.Add(Players[playerNumber]); //Sum = Sum + (int)Ranks[playerNumber]; //Players.Remove(Players[playerNumber].ToString()); //Ranks.Remove(Ranks[playerNumber]); // } //if (y == 1) //{ // foreach (string s in Team) // { // Team1.AppendText(s); // Team1.AppendText("\r\n"); // //Team1Sum.Text = Sum.ToString(); // } //} //if (y == 2) //{ // foreach (string s in Team) // { // Team2.AppendText(s); // Team2.AppendText("\r\n"); // // Team2Sum.Text = Sum.ToString(); // } //} //if (y == 3) //{ // foreach (string s in Team) // { // Team3.AppendText(s); // Team3.AppendText("\r\n"); // // Team3Sum.Text = Sum.ToString(); // } //} //if (y == 4) //{ // foreach (string s in Team) // { // Team4.AppendText(s); // Team4.AppendText("\r\n"); // // Team4Sum.Text = Sum.ToString(); // } //} //if (y == 5) //{ // foreach (string s in Team) // { // Team5.AppendText(s); // Team5.AppendText("\r\n"); // //Team5Sum.Text = Sum.ToString(); // } //} //if (y == 6) //{ // foreach (string s in Team) // { // Team6.AppendText(s); // Team6.AppendText("\r\n"); // //Team6Sum.Text = Sum.ToString(); // } //} //if (y == 7) //{ // foreach (string s in Team) // { // Team7.AppendText(s); // Team7.AppendText("\r\n"); // //Team7Sum.Text = Sum.ToString(); // } //} //if (y == 8) //{ // foreach (string s in Team) // { // Team8.AppendText(s); // Team8.AppendText("\r\n"); // } //} //if (y == 9) //{ // foreach (string s in Team) // { // Team9.AppendText(s); // Team9.AppendText("\r\n"); // } //} //if (y == 10) //{ // foreach (string s in Team) // { // Team10.AppendText(s); // Team10.AppendText("\r\n"); // } //} //if (y == 11) //{ // foreach (string s in Team) // { // Team11.AppendText(s); // Team11.AppendText("\r\n"); // } //} //if (y == 12) //{ // foreach (string s in Team) // { // Team12.AppendText(s); // Team12.AppendText("\r\n"); // } //} //if (y == 13) //{ // foreach (string s in Team) // { // Team13.AppendText(s); // Team13.AppendText("\r\n"); // } //} //if (y == 14) //{ // foreach (string s in Team) // { // Team14.AppendText(s); // Team14.AppendText("\r\n"); // } //} } }
private void AddPlayers() { int Team1, Team2, Team3, Team4; Team1 = Team2 = Team3 = Team4 = 0; int team; foreach (PlayerMobile pm in m_PBGI.Players) { team = pm.FindItemOnLayer(Layer.TwoHanded).Hue; switch (team) { case 3: { if (pm.ChestArmor != null && pm.ChestArmor.Hue == team) { AddLabel(25, 95 + Team1 * 20, 3, pm.Name); } else { AddLabel(25, 95 + Team1 * 20, 1153, pm.Name); } Team1 += 1; break; } case 38: { if (pm.ChestArmor != null && pm.ChestArmor.Hue == team) { AddLabel(172, 95 + Team2 * 20, 38, pm.Name); } else { AddLabel(172, 95 + Team2 * 20, 1153, pm.Name); } Team2 += 1; break; } case 68: { if (m_PBGI.Teams > 2) { if (pm.ChestArmor != null && pm.ChestArmor.Hue == team) { AddLabel(318, 95 + Team3 * 20, 68, pm.Name); } else { AddLabel(318, 95 + Team3 * 20, 1153, pm.Name); } Team3 += 1; } break; } case 53: { if (m_PBGI.Teams > 3) { if (pm.ChestArmor != null && pm.ChestArmor.Hue == team) { AddLabel(463, 95 + Team4 * 20, 53, pm.Name); } else { AddLabel(463, 95 + Team4 * 20, 1153, pm.Name); } Team4 += 1; } break; } default: break; } } AddLabel(44, 70, 3, "Team 1 - " + Team1.ToString()); AddLabel(188, 70, 38, "Team 2 - " + Team2.ToString()); if (m_PBGI.Teams > 2) { AddLabel(334, 70, 68, "Team 3 - " + Team3.ToString()); } if (m_PBGI.Teams > 3) { AddLabel(478, 70, 53, "Team 4 - " + Team4.ToString()); } }
private void AddPlayers() { int team, Team1, Team2, Team3, Team4; Team1 = Team2 = Team3 = Team4 = 0; int team1hue, team2hue, team3hue, team4hue; team1hue = team2hue = team3hue = team4hue = 0; team1hue = m_PBGI.m_Team1Hue; team2hue = m_PBGI.m_Team2Hue; team3hue = m_PBGI.m_Team3Hue; team4hue = m_PBGI.m_Team4Hue; ArrayList PlayerTotal; PlayerTotal = new ArrayList(); Item cloak; if (m_PBGI.Players != null) { foreach (Mobile mob in m_PBGI.Players) { PlayerTotal.Add(mob); } } if (m_PBGI.NpcPlayers != null) { foreach (Mobile npc in m_PBGI.NpcPlayers) { PlayerTotal.Add(npc); } } if (PlayerTotal != null) { foreach (Mobile pm in PlayerTotal) { cloak = pm.FindItemOnLayer(Layer.Cloak); if (cloak != null) { team = cloak.Hue; if (team == team1hue) { AddLabel(25, 95 + Team1 * 20, team1hue, pm.Name); Team1 += 1; } else if (team == team2hue) { AddLabel(172, 95 + Team2 * 20, team2hue, pm.Name); Team2 += 1; } else if (team == team3hue) { AddLabel(318, 95 + Team3 * 20, team3hue, pm.Name); Team3 += 1; } else if (team == team4hue) { AddLabel(463, 95 + Team4 * 20, team4hue, pm.Name); Team4 += 1; } else { } } } } AddLabel(44, 70, m_PBGI.m_Team1Hue, m_PBGI.Team1Name + " - " + Team1.ToString()); AddLabel(188, 70, m_PBGI.m_Team2Hue, m_PBGI.Team2Name + " - " + Team2.ToString()); if (m_PBGI.Teams > 2) { AddLabel(334, 70, m_PBGI.m_Team3Hue, m_PBGI.Team3Name + " - " + Team3.ToString()); } if (m_PBGI.Teams > 3) { AddLabel(478, 70, m_PBGI.m_Team4Hue, m_PBGI.Team4Name + " - " + Team4.ToString()); } }