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

The trainers database – every trainer class, keyed by name. More...

#include <trainers.h>

Inheritance diagram for TrainersDB:
Collaboration diagram for TrainersDB:

Public Member Functions

const QVector< TrainerDBEntry * > getStore () const
 All trainer classes.
const QHash< QString, TrainerDBEntry * > getInd () const
 Name->entry index.
int getStoreSize () const
 Trainer-class count.
TrainerDBEntrygetStoreAt (int idx) const
 Trainer by store index (for QML).
TrainerDBEntrygetIndAt (const QString &key) const
 Trainer by name key (for QML).
void load ()
 Load trainers from JSON.
void index ()
 Build the name->entry index.
void qmlProtect (const QQmlEngine *const engine) const
 Pin to C++ ownership.

Static Public Member Functions

static TrainersDBinst ()
 < Number of trainer classes.

Detailed Description

The trainers database – every trainer class, keyed by name.

Standard DB-singleton with a name index (see CreditsDB / db.md).

See also
TrainerDBEntry, DB.

Definition at line 57 of file trainers.h.

Member Function Documentation

◆ getInd()

const QHash< QString, TrainerDBEntry * > TrainersDB::getInd ( ) const
nodiscard

Name->entry index.

Definition at line 45 of file trainers.cpp.

◆ getIndAt()

TrainerDBEntry * TrainersDB::getIndAt ( const QString & key) const

Trainer by name key (for QML).

Definition at line 54 of file trainers.cpp.

Referenced by MapDBEntrySpriteTrainer::deepLink().

◆ getStore()

const QVector< TrainerDBEntry * > TrainersDB::getStore ( ) const
nodiscard

All trainer classes.

Definition at line 44 of file trainers.cpp.

◆ getStoreAt()

TrainerDBEntry * TrainersDB::getStoreAt ( int idx) const

Trainer by store index (for QML).

Definition at line 48 of file trainers.cpp.

◆ getStoreSize()

int TrainersDB::getStoreSize ( ) const
nodiscard

Trainer-class count.

Definition at line 46 of file trainers.cpp.

◆ index()

void TrainersDB::index ( )

Build the name->entry index.

Definition at line 69 of file trainers.cpp.

◆ inst()

TrainersDB * TrainersDB::inst ( )
static

< Number of trainer classes.

The process-wide TrainersDB singleton.

Definition at line 38 of file trainers.cpp.

Referenced by MapDBEntrySpriteTrainer::deepLink(), DB::qmlProtect(), and DB::trainers().

◆ load()

void TrainersDB::load ( )

Load trainers from JSON.

Definition at line 59 of file trainers.cpp.

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

◆ qmlProtect()

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

Pin to C++ ownership.

Definition at line 80 of file trainers.cpp.

References Utility::qmlProtectUtil().

Referenced by DB::qmlProtect().


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