public static void CreateNewUser(string username, ChannelMessageEventArgs command) { PokemonTrainer pt = new PokemonTrainer(); pt.trainerLevel = 1; pt.wins = 0; pt.losses = 0; pt.pokemon = new List<Pokemon>(); PokemonMaster.Instance.trainerList.Add(username, pt); SaveTrainerList(); PokemonMaster.Instance.CheckForCommands(command); }
public static string GetUserPokemon(string username) { PokemonTrainer p = new PokemonTrainer(); if (PokemonMaster.Instance.trainerList.TryGetValue(username, out p)) { string s = ""; if (!string.IsNullOrEmpty(p.pokemon[0].name)) { for (int i = 0; i < p.pokemon.Count; i++) { s += (i + 1) + ": " + p.pokemon[i].name + ", "; } s = s.TrimEnd(',', ' '); } return s = s + " -- Use !pokemon # to get info about a specific pokemon."; } else throw new Exception("No user found. This should never happen as its checked prior to this running."); }