Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
PokemonDB Class Reference

The Pokemon database – all 151 species, keyed by name. More...

#include <pokemon.h>

Inheritance diagram for PokemonDB:
Collaboration diagram for PokemonDB:

Public Member Functions

const QVector< PokemonDBEntry * > getStore () const
 All species.
const QHash< QString, PokemonDBEntry * > getInd () const
 Name->species index.
int getStoreSize () const
 Species count.
PokemonDBEntrygetStoreAt (int idx) const
 Species by store index (for QML).
PokemonDBEntrygetIndAt (const QString &key) const
 Species by name key (for QML).
void load ()
 Load species from JSON.
void index ()
 Build the name->species index.
void deepLink ()
 Resolve every species' cross-reference web.
void qmlProtect (const QQmlEngine *const engine) const
 Pin to C++ ownership.

Static Public Member Functions

static PokemonDBinst ()
 < Number of species.

Detailed Description

The Pokemon database – all 151 species, keyed by name.

Standard DB-singleton with a name index and the (heaviest) deepLink() pass. See CreditsDB / db.md.

See also
PokemonDBEntry, DB.

Definition at line 146 of file pokemon.h.

Member Function Documentation

◆ deepLink()

void PokemonDB::deepLink ( )

Resolve every species' cross-reference web.

Definition at line 228 of file pokemon.cpp.

◆ getInd()

const QHash< QString, PokemonDBEntry * > PokemonDB::getInd ( ) const
nodiscard

Name->species index.

Definition at line 190 of file pokemon.cpp.

◆ getIndAt()

◆ getStore()

const QVector< PokemonDBEntry * > PokemonDB::getStore ( ) const
nodiscard

All species.

Definition at line 189 of file pokemon.cpp.

◆ getStoreAt()

PokemonDBEntry * PokemonDB::getStoreAt ( int idx) const

Species by store index (for QML).

Definition at line 193 of file pokemon.cpp.

Referenced by PokemonBox::newPokemon().

◆ getStoreSize()

int PokemonDB::getStoreSize ( ) const
nodiscard

Species count.

Definition at line 191 of file pokemon.cpp.

Referenced by PokemonBox::newPokemon().

◆ index()

void PokemonDB::index ( )

Build the name->species index.

Definition at line 214 of file pokemon.cpp.

◆ inst()

◆ load()

void PokemonDB::load ( )

Load species from JSON.

Definition at line 204 of file pokemon.cpp.

References GameData::inst(), and GameData::json().

◆ qmlProtect()

void PokemonDB::qmlProtect ( const QQmlEngine *const engine) const

Pin to C++ ownership.

Definition at line 237 of file pokemon.cpp.

References Utility::qmlProtectUtil().

Referenced by DB::qmlProtect().


The documentation for this class was generated from the following files: