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

The TM/HM database – the ordered list of TM/HM moves and their items. More...

#include <tmHm.h>

Inheritance diagram for TmHmsDB:
Collaboration diagram for TmHmsDB:

Public Member Functions

const QVector< QString > getStore () const
 Move names in TM/HM order.
int getStoreSize () const
 TM+HM count.
const QVector< ItemDBEntry * > & getTmHmItems () const
 The item for each TM/HM (parallel to store).
const QVector< MoveDBEntry * > & getTmHmMoves () const
 The move for each TM/HM (parallel to store).
void load ()
 Load the TM/HM list from JSON.
void deepLink ()
 Resolve the parallel item/move vectors.
void qmlProtect (const QQmlEngine *const engine) const
 Pin to C++ ownership.

Static Public Member Functions

static TmHmsDBinst ()
 < Number of TMs+HMs.

Detailed Description

The TM/HM database – the ordered list of TM/HM moves and their items.

Slightly different shape from the other DBs: the store is just a vector of move-name strings (TM/HM order), and deepLink() resolves two parallel vectors – getTmHmItems (the item for each TM/HM) and getTmHmMoves (the move). No per-entry struct. See db.md for the singleton/deepLink convention.

See also
ItemsDB, MovesDB.

Definition at line 40 of file tmHm.h.

Member Function Documentation

◆ deepLink()

void TmHmsDB::deepLink ( )

Resolve the parallel item/move vectors.

Definition at line 56 of file tmHm.cpp.

References ItemsDB::getIndAt(), MovesDB::getIndAt(), ItemsDB::inst(), and MovesDB::inst().

◆ getStore()

const QVector< QString > TmHmsDB::getStore ( ) const
nodiscard

Move names in TM/HM order.

Definition at line 41 of file tmHm.cpp.

◆ getStoreSize()

int TmHmsDB::getStoreSize ( ) const
nodiscard

TM+HM count.

Definition at line 42 of file tmHm.cpp.

◆ getTmHmItems()

const QVector< ItemDBEntry * > & TmHmsDB::getTmHmItems ( ) const
nodiscard

The item for each TM/HM (parallel to store).

Definition at line 43 of file tmHm.cpp.

◆ getTmHmMoves()

const QVector< MoveDBEntry * > & TmHmsDB::getTmHmMoves ( ) const
nodiscard

The move for each TM/HM (parallel to store).

Definition at line 44 of file tmHm.cpp.

◆ inst()

TmHmsDB * TmHmsDB::inst ( )
static

< Number of TMs+HMs.

The process-wide TmHmsDB singleton.

Definition at line 35 of file tmHm.cpp.

Referenced by DB::qmlProtect(), and DB::tmHms().

◆ load()

void TmHmsDB::load ( )

Load the TM/HM list from JSON.

Definition at line 46 of file tmHm.cpp.

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

◆ qmlProtect()

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

Pin to C++ ownership.

Definition at line 75 of file tmHm.cpp.

References Utility::qmlProtectUtil().

Referenced by DB::qmlProtect().


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