Commit 1c4a429f authored by elijah vasquez's avatar elijah vasquez 🦍

reorganised

parent 8ca6dec1
typedef struct Pokedex // Pokedex structure // Pokemon List
typedef struct PokemonNode
{ {
PokemonNode *headNode; char pokemonName[20];
PlayerNode *headPlayer; char pokemonType[20];
}Pokedex;
typedef struct PokemonNode // Pokemon List
{
char pokemonName[15];
char pokemonType[15];
char pokemonAbility[30]; char pokemonAbility[30];
}PokemonNode;
typedef struct PlayerNode // Player List struct PokemonNode *next;
} PokemonNode;
// Player List
typedef struct PlayerNode
{ {
char playerName[50]; char playerName[50];
int totalPokemon; int totalPokemon;
PokemonNode PokemonArray[20]; PokemonNode *PokemonArray[20];
}PlayerNode; struct PlayerNode *next;
} PlayerNode;
// Pokedex structure
typedef struct Pokedex
{
PokemonNode *pokemonNodehead;
PlayerNode *PlayerNodehead;
} Pokedex;
// Pokemon List functions // Pokemon List functions
PokemonNode* NewPokemonNode(char name[15], char type[20], char ability[30]); PokemonNode* NewPokemonNode(char name[15], char type[20], char ability[30]);
void AddPokemonToList(Pokedex *pokedex, char name[15], char type[20], char ability[30]); void AddPokemonToList(Pokedex **pokedex, char name[15], char type[20], char ability[30]);
PokemonNode* FindPokemon(Pokedex pokedex, char name[15]); PokemonNode* FindPokemon(Pokedex pokedex, char name[15]);
// Player List functions // Player List functions
PlayerNode* NewPlayerNode(char name[50]); PlayerNode* NewPlayerNode(char name[50]);
void AddPlayerToList(Pokedex *pokedex, char name[50]); void AddPlayerToList(Pokedex *pokedex, char name[50]);
PlayerNode* FindPlayer(pokedex, char name[50]); PlayerNode* FindPlayer(Pokedex pokedex, char name[50]);
// Additional functions // Additional functions
void AddPokemonToPlayer(pokedex, playerName[50], pokemonName[15]); void AddPokemonToPlayer(Pokedex pokedex, playerName[50], pokemonName[15]);
void DisplayPokemonDetails(pokedex, name); void DisplayPokemonDetails(pokedex, name);
void DisplayPlayerDetails(pokedex, name); void DisplayPlayerDetails(pokedex, name);
void ListPokemon(pokedex); void ListPokemon(Pokedex* pokedex);
void ListPlayers(pokedex); void ListPlayers(Pokedex* pokedex);
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include "functions.h" #include "functions.h"
int main(void) int main(void)
{ {
Pokedex pokedex; // Variable of Pokedex
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