void CheckChickenBoard(string chan) { ChickenScoreClass first = new ChickenScoreClass(); ; ChickenScoreClass second = new ChickenScoreClass(); ChickenScoreClass third = new ChickenScoreClass(); for (int i = 0; i < chickenScore.Count; ++i) { if (i != 0) { if (chickenScore[i].score > first.score) { first = chickenScore[i]; } else if (chickenScore[i].score > second.score) { second = chickenScore[i]; } else if (chickenScore[i].score > first.score) { third = chickenScore[i]; } } else { first = chickenScore[i]; if (chickenScore.Count >= 2) second = chickenScore[i]; if (chickenScore.Count >= 3) third = chickenScore[i]; } } client.LocalUser.SendMessage(chan, string.Format("First: {0} {1} - Second: {2} {3} - Third: {4} {5}", first.name, first.score, second.name, second.score, third.name, third.score )); }
void AddChickenScore(string name) { bool found = false; for (int i = 0; i < chickenScore.Count; ++i) { if (chickenScore[i].name.ToLower() == name.ToLower()) { chickenScore[i].score += 1; found = true; break; } } if (!found) { ChickenScoreClass cs = new ChickenScoreClass(); cs.name = name; cs.score = 1; chickenScore.Add(cs); } }