From 58e3c1c73402f95f8b1bb90f7183cc554fee62cb Mon Sep 17 00:00:00 2001 From: cdemeyer-teachx Date: Wed, 20 Aug 2025 15:54:17 +0900 Subject: [PATCH] prompt description --- Prompts/6-pokemonTable | 2 ++ include/core/pokemon.h | 37 +++---------------------------------- 2 files changed, 5 insertions(+), 34 deletions(-) create mode 100644 Prompts/6-pokemonTable diff --git a/Prompts/6-pokemonTable b/Prompts/6-pokemonTable new file mode 100644 index 0000000..04738d7 --- /dev/null +++ b/Prompts/6-pokemonTable @@ -0,0 +1,2 @@ +This repo is the start of a highly performant pokemon battle simulator. +I want you to implement a pokemon data table that contains all PokemonSpecies. So we can easily access any pokemon using it's ID during runtime. \ No newline at end of file diff --git a/include/core/pokemon.h b/include/core/pokemon.h index a61c49c..c76b0a4 100644 --- a/include/core/pokemon.h +++ b/include/core/pokemon.h @@ -5,22 +5,17 @@ #include "stats.h" #include "types.h" #include -#include -#include -#include namespace PokEng { // Pokemon species data structure struct PokemonSpecies { - std::string_view name; + PokemonSpecies() = default; + + std::string name; uint16_t id; BaseStats base_stats; PokemonTypes types; - - constexpr PokemonSpecies(uint16_t id_, std::string_view name_, - const BaseStats& stats, const PokemonTypes& types_) - : name(name_), id(id_), base_stats(stats), types(types_) {} }; // Pokemon Archetype - contains information on how a pokemon will be instantiated @@ -114,32 +109,6 @@ private: uint8_t m_friendship = 0; }; -// Pokemon lookup tables for each generation -template -class PokemonDataTable { -public: - // Get Pokemon species data by ID - static const PokemonSpecies* getSpecies(uint16_t id); - - // Get Pokemon species data by name - static const PokemonSpecies* getSpecies(std::string_view name); - - // Check if Pokemon exists in this generation - static bool exists(uint16_t id); - - // Get total number of Pokemon in this generation - static size_t getCount(); - -private: - static const std::unordered_map& getTable(); - static const std::unordered_map& getNameTable(); -}; - -// Convenience typedefs for different generations -using Gen1PokemonData = PokemonDataTable; -using Gen2PokemonData = PokemonDataTable; -using Gen3PokemonData = PokemonDataTable; - } // namespace PokEng #endif // POKEMON_H