- Create a struct called Podedex with 2 pointers (head of pokemon list and head of player list)
- Create variable called pokedex of type 'Pokedex' (to pass into functions)
Pokemon List
- Create doubly linked list of pokemon
- create a stuct for each pokemon in the list called PokemonNode
^ This will store: name, type, primary ability (all strings) (Assume each has only one type+ability)
- Create functions:
^PokemonNode * NewPokemonNode(name,type,ability) - create node and return pointer to it
^void AddPokemonToList(*pokedex, name, type, ability) - IF pokemonName NOT IN pokemonList: create and add new node ELSE: do nothing
^PokemonNode * FindPokemon(pokedex, name) - searches pokemon list for name, returns pointer to names node, if found and NULL if not
Player List
- Create doubly linked list of players
- create a stuct for each player in the list called PlayerNode
^ This will store: player name, a count of pokemon owned, and array of pointers to the pokemon owned by the player
- Create functions
^PlayerNode * NewPlayerNode(name) - creates new node and returns pointer (pokemon count start at 0)
^void AddPlayerToList(*pokedex, name) - checks to seee if name exists in player list, if it doesnt then create node and add to list, if it does then do nothing
^PlayerNode * FindPlayer(pokedex, name) - searches the player list the name and returns a pointer to the node if it finds it, otherwise NULL
- Create functions:
^void AddPokemonToPlayer(pokedex, player name, pokemon name) -adds pokemon to players list (if not already there) and increments the pokemon count by 1
^PokemonNode * PokemonArray[20] as part of player node - stores pointers to the nodes in Pokemon list for the pokemon that the player has captured
^void DisplayPokemonDetails(pokedex, name) - outputs details of name to the screen
^void DiplayPlayerDetails(pokedex, name) - outputs details of name to the screen, including list of names of pokemon owned
^void ListPokemon(pokedex) - output list of names of all pokemon in the pokedex
^void ListPlayers(pokedex) - outputs list of names of all players in the Pokedex.