public List <Pokemon> GetEncounterablePokemon(int locationID) { List <object[]> data = context.GetEncounterablePokemon(locationID); List <Pokemon> pokemonAtLocation = new List <Pokemon>(); foreach (object[] row in data) { object[] typeData = context.GetPokemonType(Convert.ToInt32(row[0])); Type type = new Type(Convert.ToInt32(typeData[0]), typeData[1].ToString()); List <Move> pokemonMoves = GetPokedexPokemonMoves(Convert.ToInt32(row[0]), Convert.ToInt32(row[3])); pokemonAtLocation.Add(new Pokemon(type, pokemonMoves, Convert.ToInt32(row[0]), row[1].ToString(), Convert.ToBoolean(row[2]), ConvertToInt32(row[3]), ConvertToInt32(row[4]), ConvertToInt32(row[5]), ConvertToInt32(row[6]), ConvertToInt32(row[7]), ConvertToInt32(row[8]), ConvertToInt32(row[9]), ConvertToInt32(row[10]), ConvertToInt32(row[11]))); } return(pokemonAtLocation); }