It is not as big as it looks. Most are in comment section explaining clearly what to do. You will…

It is not as big as it looks. Most are in comment section explaining clearly what to do. You will have to do the //TODO parts only and it is a fun project. POKEDEX.JAVA import java.util.Iterator; import java.util.ArrayList; import java.io.FileNotFoundException; import java.io.File; import java.util.Scanner; /** * The Pokedex maintains the list of Pokemon species that have been encountered by the trainer. * It also maintains the trainer’s inventory of Pokemon belonging to a particular species */ public class Pokedex { private ArrayList pokedex; /** * Create a new, empty Pokedex */ public Pokedex() { pokedex = new ArrayList(); } /** * Load Pokedex from a file and update the Pokedex object’s private pokedex. * * This function does not provide de-duplication (if Gengar is already in your Pokedex and you loadFromFile * a Pokedex that also has a Gengar, you will have two entries of Gengar in your Pokedex). * An error is thrown to prevent duplicate entries. * * @param filepath the Pokedex to load; the file is expected to have lines delimited by white space with the * following fields: * [, , …] * for example: * 94 gengar 3 2289 * 110 weezing 6 457 148 * @throws PokedexException if the pokedex has already been loaded (pokedex is not empty) with message Config.MULTIPLE_POKEDEX_EXCEPTION * @throws FileNotFoundException if the file in @filepath@ cannot be found */ public void loadFromFile(String filepath) throws FileNotFoundException, PokedexException { // TODO } /** * Create a record of a new Pokemon species in the Pokedex; used by PokemonTrainer when * the player encounters a new Pokemon and that Pokemon escapes. This method is also * used by other Pokedex methods such as addNewPokemon to make record of any * encountered Pokemon (whether that Pokemon is captured or escapes) * * @param species the PokemonSpecies that has been encountered */ public void addNewSpecies(PokemonSpecies species) { // TODO } /** * Add a new Pokemon to the player’s inventory; may add a new species to the Pokedex * if the Pokemon being added has not been encountered before. Used by PokemonTrainer * when the player encounters and catches a Pokemon. * * @param pokemon the new Pokemon that has been caught */ public void addNewPokemon(Pokemon pokemon) { // TODO } /** * Transfer a Pokemon to the Professor. The Professor thanks the player by providing a candy * associated with the Pokemon species of the Pokemon that was transferred. * * @param speciesName the species of the {@link Pokemon} to transfer * @param cp the combatPower of the {@link Pokemon} to transfer * @return the pokemon that was tranferred * @throws PokedexException when either the Pokemon species given by the species name has not * yet been encountered by the player or if there is no Pokemon with the combatPower given in cp */ public Pokemon transferPokemon(String speciesName, int cp) throws PokedexException { // TODO } /** * Lookup a species in the Pokedex; if it has been seen before, return its data; * otherwise, throw PokedexException. * * @param name the species name to lookup in the Pokedex * @return the PokemonSpecies with speciesName given by name * @throws PokedexException if the PokemonSpecies cannot be found (the player has not * yet encountered this species) */ public PokemonSpecies findSeenSpeciesData(String name) throws PokedexException { // TODO } /** * While {@link findSeenSpeciesData} returns information for all Pokemon observed (and * caught), this function only returns species data for Pokemon that the Trainer has in * his or her inventory. * * @param speciesName the name of the species to find in the Pokedex * @throws PokedexException [Config.UNSEEN_POKEMON] if the species has not been encountered or [Config.UNCAUGHT_POKEMON] if the player * does not have any Pokemon of that species in his or her inventory */ public PokemonSpecies findCaughtSpeciesData(String speciesName) throws PokedexException { // TODO } /** * Create a String with the encountered Pokemon in the form: * Bulbasaur * Charmander * … * where Pokemon species are listed in the order they have been encountered * * @return the String as described above */ public String seenPokemonMenu() { // TODO } /** * While {@link seenPokemonMenu} returns a String with all Pokemon in the Pokedex (even ones that the * trainer failed to capture), this function returns a String containing only Pokemon current in * the trainer’s inventory * * @return the String as described above */ public String caughtPokemonMenu() { // TODO } /** * Serialize Pokedex into a String for a save file. The file format is described * in {@link loadFromFile} * * @return the complete Pokedex in String form, ready to be written to a file */ public String toString() { // TODO } } ——————————————————————————- POKEMONDB.JAVA import java.io.File; import java.util.Scanner; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Iterator; /** * This class provides functions for interacting with the set of Pokemon that the player * will encounter during the course of the game. */ public class PokemonDB { public static final int NUM_POKEMON = 151; public static final int WILD_CANDIES = 3; private static ArrayList pokemonSpeciesNames; /** * Create a PokemonDB by parsing the Pokemon file in @path@ * * @param path the file path that contains the Pokemon used for this game */ public PokemonDB(String path) throws FileNotFoundException { pokemonSpeciesNames = new ArrayList(); File infile = new File(path); loadFile(infile); } /** * Parse Pokemon file with format * n * File lines must be ordered from PokedexNumber and start from 1 * * @param infile the file with all the Pokemon that will be used for this game */ public void loadFile(File infile) throws FileNotFoundException { Scanner sc = new Scanner(infile); while(sc.hasNextLine()) { String line = sc.nextLine(); String[] tokens = line.split(“\s+”); String name = tokens[1]; name = name.toLowerCase(); // to make sure all cases are acceptable pokemonSpeciesNames.add(name); } sc.close(); } /** * Generate a Pokedex Number to (1) provide a Pokemon for an encounter and (2) * provide a set of alternative options for the Pokedex Number guessing game to * capture the encountered Pokemon * * @return the Pokedex Number generated */ public int generatePokedexNumber() { int pokedexNumber = Config.POKEDEX_NUMBER_GENERATOR.nextInt(PokemonDB.NUM_POKEMON-1)+1; // adjustments for origin 0/1 return pokedexNumber; } /** * Lookup a Pokemon species name using its Pokedex Number (the index+1 of the * string in pokemonSpeciesNames which matches the parameter pokedexNumber) * * @param pokedexNumber find the Pokemon species name associated with this number * @throws PokedexException thrown if the pokedexNumber is not in the range 1 to * NUM_POKEMON (inclusive) */ public String lookupSpeciesName(int pokedexNumber) throws PokedexException { // TODO } /** * Lookup a Pokedex Number using its species name * * @param speciesName the name of the Pokemon species to find the Pokedex Number for * @throws PokedexException if the speciesName is not in the database */ public int lookupPokedexNumber(String speciesName) throws PokedexException { int rv = 0; Iterator it = pokemonSpeciesNames.iterator(); int i = 1; while(it.hasNext()) { String name = it.next(); if(speciesName.equals(name)) { rv = i; } i += 1; } if(rv == 0) { throw new PokedexException(String.format(Config.INVALID_POKEMON_SPECIES, speciesName)); } return rv; } } ————————————————————————— POKEMONGO.JAVA import java.util.Arrays; import java.util.ArrayList; import java.util.Iterator; import java.util.InputMismatchException; import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; /** * The main class. Provides the main method which is responsible for game play. * Also provides assistance for gameplay with functions to generate Pokemon, and * save a player’s progress. */ public class PokemonGO { public static final int NEW_POKEMON_CANDIES = 3; public static final int TRANSFER_POKEMON_CANDIES = 1; /** * The game begins here! The set of Pokemon that the player will encounter * must be provided as the first and only command-line argument which will * be loaded into the {@link PokemonDB} * * Players are prompted to enter their name which will be used to save their * progress. Players are then prompted with a set of menu options which can * be selected by entering a single character e.g. ‘s’ for “search”. Options * include search for Pokemon, display encountered Pokemon, display caught Pokemon, * transfer caught Pokemon, and quit. * * @param args the command line arguments. args[0] must be a file which is loaded * by {@link PokemonDB} */ public static void main(String[] args) throws FileNotFoundException { // Interpret command-line arguments and use them to load PokemonDB if(args.length != 1) { System.err.println(“Invalid arguments”); System.exit(1); } PokemonDB db = new PokemonDB(args[0]); // Start System.out.println(Config.WELCOME); // Prompt user to enter player name System.out.println(Config.USER_PROMPT); // Take name of Pokemon trainer String playerName = Config.getNextLine(); // Provide a name for a txt file which will be used to save the player’s progress String playerFileName = playerName + “.txt”; Pokedex pokedex = new Pokedex(); try { pokedex.loadFromFile(playerFileName); } catch (FileNotFoundException e) { // then the player has not saved any progress yet, start a new game! } PokemonTrainer pokemonTrainer = new PokemonTrainer(playerName, pokedex); System.out.println(“Hi ” + playerName); // main menu for the game. accept commands until the player enters ‘q’ to quit String option = null; while ((!”Q”.equals(option)) && (!”q”.equals(option))) { // Ask user to choose // [C] display caught Pokemon // [D]isplay encountered Pokemon // [S]earch for Pokemon // [T]ransfer Pokemon to the Professor // [Q]uit System.out.println(Config.MENU_PROMPT); option = Config.getNextLine(); switch(option) { case “C”: case “c”: System.out.println(pokemonTrainer.getPokedex().caughtPokemonMenu()); break; case “D”: case “d”: System.out.println(pokemonTrainer.getPokedex().seenPokemonMenu()); break; case “S”: case “s”: Pokemon wildPokemon = encounterPokemon(db); // Provide alternative guessing options int[] pokedexNumbers = new int[Config.DIFFICULTY]; pokedexNumbers[0] = wildPokemon.getPokedexNumber(); for(int i = 1; i pokedexNumbers[i] = db.generatePokedexNumber(); } Arrays.sort(pokedexNumbers); // Prompt user for input System.out.println(String.format( Config.ENCOUNTERED_POKEMON, wildPokemon.getSpecies(), wildPokemon.getCombatPower(), Arrays.toString(pokedexNumbers))); int guessedId = 0; while(guessedId 151) { // then prompt is invalid try { guessedId = Config.getNextInteger(); if(guessedId 151) { throw new RuntimeException(Config.INVALID_INT_INPUT); } } catch (InputMismatchException e) { System.out.println(Config.INVALID_INT_INPUT); Config.getNextLine(); } catch (RuntimeException e) { System.out.println(Config.INVALID_INT_INPUT); } } if (guessedId == wildPokemon.getPokedexNumber()) { // guessed correctly, pokemon is captured pokemonTrainer.capturePokemon(wildPokemon); System.out.println(String.format( Config.SUCCESSFUL_CAPTURE, playerName, wildPokemon.getSpecies(), wildPokemon.getCombatPower())); } else { // guessed incorrectly, pokemon escapes pokemonTrainer.seePokemon(wildPokemon); System.out.println(String.format( Config.FAILED_CAPTURE, playerName, wildPokemon.getSpecies())); } break; case “T”: case “t”: // Select Pokemon species to transfer System.out.println(Config.TRANSFER_PROMPT); pokedex = pokemonTrainer.getPokedex(); String speciesName = Config.getNextLine(); if(speciesName.toLowerCase().equals(“cancel”)) { break; } try { db.lookupPokedexNumber(speciesName); } catch (PokedexException e) { System.out.println(e.toString()); break; } // Begin transfer of selected species PokemonSpecies species = null; try { species = pokedex.findCaughtSpeciesData(speciesName); } catch (PokedexException e) { System.out.println(e.toString()); break; } String transferPokemonName = species.getSpeciesName(); // Select Pokemon of that species to transfer System.out.println(String.format( Config.TRANSFER_CP_PROMPT, transferPokemonName, species.caughtPokemonToString())); int transferPokemonCp = -1; while(transferPokemonCp == -1) { try { transferPokemonCp = Config.getNextInteger(); if(transferPokemonCp System.out.println(Config.INVALID_CP_INPUT); transferPokemonCp = -1; } } catch (InputMismatchException e) { System.out.println(Config.INVALID_CP_INPUT); transferPokemonCp = -1; Config.getNextLine(); } catch (RuntimeException e) { System.out.println(Config.INVALID_CP_INPUT); transferPokemonCp = -1; } } if(transferPokemonCp == 0) { break; } try { // Call transfer function; should throw exceptions within transfer but are to be caught here pokemonTrainer.transferPokemon(transferPokemonName, transferPokemonCp); System.out.println(String.format( Config.SUCCESSFUL_TRANSFER, transferPokemonName, transferPokemonCp)); } catch (PokedexException pokedexException) { System.out.println (pokedexException.toString()); } break; case “Q”: case “q”: break; default: System.out.println(Config.INVALID_RESPONSE); } } // Save the game when the player quits File outFile = new File(playerFileName); saveGame(outFile, pokemonTrainer); System.out.println(String.format( Config.QUIT_MESSAGE, playerName)); } /** * A wild has appeared! ~*~ battle music plays ~*~ * * @param db the PokemonDB to generate a Pokemon from * @return a Pokemon for the encounter */ public static Pokemon encounterPokemon(PokemonDB db) { // random number to pick pokemon int pokedexNumber = db.generatePokedexNumber(); String species = db.lookupSpeciesName(pokedexNumber); // random number to decide CP int cp = Config.CP_GENERATOR.nextInt(Config.MAX_CP-1)+1; // adjustments for origin 0/1 Pokemon wildPokemon = new Pokemon(pokedexNumber, species, cp); return wildPokemon; } /** * Save the game by writing the Pokedex into a file. The game can be loaded again * by functions provided by the {@link Pokedex} class * * @param outFile the file handle to write the game progress to * @param pokemonTrainer the player whose game we are saving */ public static void saveGame(File outFile, PokemonTrainer pokemonTrainer) throws FileNotFoundException { // TODO } } ————————————————————————————- POKEMONSPECIES.JAVA import java.util.ArrayList; import java.util.Iterator; /** * A PokemonSpecies entry in the Pokedex. Maintains the number of candies associated * with the Pokemon species as well as the Trainer’s inventory of Pokemon of this * species. */ public class PokemonSpecies { private int pokedexNumber; private String speciesName; private int candies; /** * Maintains the list of Pokemon of this species in the Trainer’s inventory. */ private ArrayList caughtPokemon; /** * Constructor suitable for a newly encountered Pokemon species during the course of the * game and for loading species data from a save file. * * @param pokedexNumber the Pokedex Number for the species * @param speciesName the name of the species * @param candies the number of candies the player has obtained by catching * or transferring Pokemon of this species */ public PokemonSpecies(int pokedexNumber, String speciesName, int candies) { this.pokedexNumber = pokedexNumber; this.speciesName = speciesName; this.candies = candies; // construct caughtPokemon caughtPokemon = new ArrayList(); } /** * Getter methods */ public Integer getPokedexNumber() { return pokedexNumber; } public String getSpeciesName() { return speciesName; } public int getCandies() { return candies; } /** * Add a newly caught Pokemon to the player’s inventory and * increase the number of candies for this PokemonSpecies * * @param pokemon the newly caught Pokemon */ public void addNewPokemon(Pokemon pokemon) { // TODO } /** * Helper function to load Pokemon from a save file into the player’s inventory for this * Pokemon Species * * @param pokemon the pokemon to add to this species */ public void loadPokemon(Pokemon pokemon) { caughtPokemon.add(pokemon); } /** * Find a Pokemon of the given combatPower in the player’s inventory for this species. * * @param cp the combatPower of the Pokemon to find * @throws PokedexException [Config.POKEMON_NOT_FOUND] if there is no Pokemon with the * given combatPower in the player’s inventory. * @return the first Pokemon with the provided combatPower */ public Pokemon findPokemon(int cp) throws PokedexException { // TODO } /** * Transfer a Pokemon with the provided combatPower from the player’s inventory * to the Professor. This removes the Pokemon from the player’s inventory and * also increases the number of candies the player has associated with this * PokemonSpecies. * * @param cp the combatPower of the Pokemon to transfer * @throws PokedexException if the player does not have a Pokemon with the given * combatPower * @return the transferred Pokemon */ public Pokemon transferPokemon(int cp) throws PokedexException { // TODO } /** * Check if the player has any Pokemon of this species * @return false if the player has Pokemon of this species in his or her inventory * and true otherwise */ public boolean isEmpty() { // TODO } /** * Increment candies when a new pokemon is caught */ private void addNewPokemonCandies() { this.candies += PokemonGO.NEW_POKEMON_CANDIES; } /** * Increment candies when a pokemon is transferred to the professor */ private void addTransferCandies() { this.candies += PokemonGO.TRANSFER_POKEMON_CANDIES; } /** * Prepare a listing of all the Pokemon of this species that are currently in the * player’s inventory. * * @return a String of the form * … */ public String caughtPokemonToString() { // TODO } /** * Prepare a String representing this entire PokemonSpecies. This is used to * save the PokemonSpecies (one part of the Pokedex) to a file to * save the player’s game. * * @return a String of the form * [, , …] */ public String toString() { // TODO } } ———————————————————————————— If you want to text run it, let me know and I will upload the other supporting files.Please fill in the todo parts. config.java import java.util.Scanner; import java.util.Random; /** * This class provides configuration for the game. It also provides localization Strings * for the game’s interaction with the player. * DO NOT EDIT. Your edits will not be used in the evaluation of your program. */ public class Config { /** * Random object is seeded to make “pseudo-random” values deterministic * The SEED value may be changed while completing your own testing. * For sample test runs, set both CP_SEED and POKEDEX_NUMBER_SEED values to null. */ private static final int CP_SEED = 0; private static final int POKEDEX_NUMBER_SEED = 0; public static final Random CP_GENERATOR = new Random(CP_SEED); public static final Random POKEDEX_NUMBER_GENERATOR = new Random(POKEDEX_NUMBER_SEED); public static final int MAX_CP = 3000; public static final int DIFFICULTY = 3; public static final String USAGE = “java PokemonGO “; public static final String WELCOME = “Welcome to PokemonGO 367!”; public static final String USER_PROMPT = “Please enter your name: “; public static final String TRANSFER_PROMPT = “Which Pokemon do you wish to transfer? Enter ” + “the Pokemon’s species name or type “cancel”” to cancel the transfer.””; public static final String MENU_PROMPT = “”Do you want to n”” + “” Display [C]aught pokemon