diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-12-24 20:21:16 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-12-24 20:21:16 +0100 |
commit | a2bff9393ac5e39b15534871e2bdbfc1f2fa7909 (patch) | |
tree | c92ea3abaaaef304f88ecac1865fff24e430e4a8 /oop2eindopdr/Pokedex.cpp | |
parent | d372e2ec7c67b848d7f67146506453af6d6a5379 (diff) |
value lookup + short display format for search result list
Diffstat (limited to 'oop2eindopdr/Pokedex.cpp')
-rw-r--r-- | oop2eindopdr/Pokedex.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/oop2eindopdr/Pokedex.cpp b/oop2eindopdr/Pokedex.cpp index 93764b4..9eb997f 100644 --- a/oop2eindopdr/Pokedex.cpp +++ b/oop2eindopdr/Pokedex.cpp @@ -4,6 +4,8 @@ #include "CacheManager.h" #include "Pokedex.h" +#include "PokemonTCGAPIClient.h" +#include "PokemonCard.h" Pokedex::Pokedex() { this->cache = new CacheManager("./cache"); @@ -24,7 +26,7 @@ void Pokedex::load_collection_remote() { std::vector<PokemonCard*> remote_cards = api->get_set_cards("swshp"); for (PokemonCard* card : remote_cards) { - card->set_cache(this->cache); + card->set_pokedex(this); this->cards.push_back(card); } this->verify_collection(); @@ -37,7 +39,7 @@ void Pokedex::load_collection_local() { std::fstream& cache_collection = *cache->cache_get("index"); std::string id; while (std::getline(cache_collection, id)) { - this->cards.push_back(new PokemonCard::from_cache(this->cache, id)); + this->cards.push_back(new PokemonCard::from_cache(this, id)); } } |