Commit 9d1811c4 authored by a-j.towse's avatar a-j.towse

need to create pokedex of type pokedex

parent 56d543e5
......@@ -9,11 +9,9 @@ A-J Towse
*/
//Create struct Pokedex with a pointer to head of Pokemon and head of Player
//Create variable of type Pokedex called pokedex.
typedef struct Pokedex {
struct Pokemon *Pokemonhead;
struct Player *Playerhead;
struct Pokedex *pokedex;
struct PokemonNode * ptrToPokemonhead;
struct PlayerNode * ptrToPlayerhead;
}Pokedex;
//Create struct PokemonNode with name,type,ability variables
......@@ -38,9 +36,14 @@ typedef struct PlayerNode {
struct PokemonNode pokemonList[];
}PlayerNode;
PokemonNode *head = NULL; //Create head for DLL of pokemon
PlayerNode *head = NULL; //Create head for DLL of players
//NEED TO CREATE VARIABLE OF TYPE POKEDEX
//Define functions for PokemonNode struct
struct PokemonNode * NewPokemonNode(char name[], char type[], char ability[] );
void AddPokemonToList(struct Pokedex *pokedex,char name, char type, char ability);
void AddPokemonToList(struct Pokedex *pokedex,char name[], char type[], char ability[]);
struct PokemonNode * FindPokemon(struct Pokedex pokedex, char name);
//Define functions for PlayerNode struct
......@@ -72,11 +75,25 @@ struct PokemonNode * NewPokemonNode(char name[], char type[], char ability[] ) {
return newNode;
}
//Create AddPokemonToList function - returns void
void AddPokemonToList(struct Pokedex *pokedex,char name[], char type[], char ability[]){
NewPokemonNode(name,type,ability);
}
int main (void) {
NewPokemonNode("Charmander","Fire","FireBallz");
//NewPokemonNode("Charmander","Fire","FireBallz");
AddPokemonToList(pokedex,"Charmander","Fire","FireBallz");
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment