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

The types database – the type list, keyed by name. More...

#include <types.h>

Inheritance diagram for TypesDB:
Collaboration diagram for TypesDB:

Public Member Functions

const QVector< TypeDBEntry * > getStore () const
 All types.
const QHash< QString, TypeDBEntry * > getInd () const
 Name->entry index.
int getStoreSize () const
 Type count.
TypeDBEntrygetStoreAt (int idx) const
 Type by store index (for QML).
TypeDBEntrygetIndAt (const QString &key) const
 Type by name key (for QML).
void load ()
 Load types 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 TypesDBinst ()
 < Number of types.

Detailed Description

The types database – the type list, keyed by name.

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

See also
TypeDBEntry, DB.

Definition at line 58 of file types.h.

Member Function Documentation

◆ getInd()

const QHash< QString, TypeDBEntry * > TypesDB::getInd ( ) const
nodiscard

Name->entry index.

Definition at line 44 of file types.cpp.

◆ getIndAt()

TypeDBEntry * TypesDB::getIndAt ( const QString & key) const

Type by name key (for QML).

Definition at line 53 of file types.cpp.

Referenced by MoveDBEntry::deepLink(), and PokemonDBEntry::deepLink().

◆ getStore()

const QVector< TypeDBEntry * > TypesDB::getStore ( ) const
nodiscard

All types.

Definition at line 43 of file types.cpp.

Referenced by TypesModel::data(), TypesModel::rowCount(), and TypesModel::valToIndex().

◆ getStoreAt()

TypeDBEntry * TypesDB::getStoreAt ( int idx) const

Type by store index (for QML).

Definition at line 47 of file types.cpp.

Referenced by PokemonBox::randomize().

◆ getStoreSize()

int TypesDB::getStoreSize ( ) const
nodiscard

Type count.

Definition at line 45 of file types.cpp.

◆ index()

void TypesDB::index ( )

Build the name->entry index.

Definition at line 68 of file types.cpp.

◆ inst()

TypesDB * TypesDB::inst ( )
static

◆ load()

void TypesDB::load ( )

Load types from JSON.

Definition at line 58 of file types.cpp.

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

◆ qmlProtect()

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

Pin to C++ ownership.

Definition at line 80 of file types.cpp.

References Utility::qmlProtectUtil().

Referenced by DB::qmlProtect().


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