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

The moves database – every move, keyed by name. More...

#include <moves.h>

Inheritance diagram for MovesDB:
Collaboration diagram for MovesDB:

Public Member Functions

const QVector< MoveDBEntry * > getStore () const
 All moves, in load order.
const QHash< QString, MoveDBEntry * > getInd () const
 Name->entry index.
int getStoreSize () const
 Move count.
MoveDBEntrygetStoreAt (int idx) const
 Move by store index (for QML).
MoveDBEntrygetIndAt (const QString &key) const
 Move by name key (for QML).
void load ()
 Load moves from JSON.
void index ()
 Build the name->entry index.
void deepLink ()
 Resolve every move's cross-DB links.
void qmlProtect (const QQmlEngine *const engine) const
 Pin to C++ ownership.

Static Public Member Functions

static MovesDBinst ()
 < Number of moves.

Detailed Description

The moves database – every move, keyed by name.

Standard DB-singleton (see CreditsDB) plus a key index: index() builds a name->entry hash so getIndAt("tackle") works, and deepLink() resolves each move's cross-references. See db.md.

See also
MoveDBEntry, DB.

Definition at line 81 of file moves.h.

Member Function Documentation

◆ deepLink()

void MovesDB::deepLink ( )

Resolve every move's cross-DB links.

Definition at line 117 of file moves.cpp.

◆ getInd()

const QHash< QString, MoveDBEntry * > MovesDB::getInd ( ) const
nodiscard

Name->entry index.

Definition at line 79 of file moves.cpp.

◆ getIndAt()

MoveDBEntry * MovesDB::getIndAt ( const QString & key) const

◆ getStore()

const QVector< MoveDBEntry * > MovesDB::getStore ( ) const
nodiscard

All moves, in load order.

Definition at line 78 of file moves.cpp.

◆ getStoreAt()

MoveDBEntry * MovesDB::getStoreAt ( int idx) const

Move by store index (for QML).

Definition at line 82 of file moves.cpp.

◆ getStoreSize()

int MovesDB::getStoreSize ( ) const
nodiscard

Move count.

Definition at line 80 of file moves.cpp.

Referenced by PokemonMove::randomize().

◆ index()

void MovesDB::index ( )

Build the name->entry index.

Definition at line 103 of file moves.cpp.

◆ inst()

◆ load()

void MovesDB::load ( )

Load moves from JSON.

Definition at line 93 of file moves.cpp.

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

◆ qmlProtect()

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

Pin to C++ ownership.

Definition at line 126 of file moves.cpp.

References Utility::qmlProtectUtil().

Referenced by DB::qmlProtect().


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