|
Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
|
Shared base for the two hidden-pickup databases (items and coins). More...
#include <abstracthiddenitemdb.h>
Public Member Functions | |
| const QVector< HiddenItemDBEntry * > | getStore () const |
| < Number of hidden pickups. | |
| int | getStoreSize () const |
| Entry count. | |
| HiddenItemDBEntry * | getStoreAt (const int ind) const |
| Entry by store index (for QML). | |
| void | load () |
| Load entries from loadFile. | |
| void | deepLink () |
| Resolve each entry's cross-DB links. | |
| void | qmlProtect (const QQmlEngine *const engine) const |
| Pin to C++ ownership. | |
Protected Member Functions | |
| virtual void | qmlRegister () const =0 |
| Subclass registers its concrete type with QML. | |
| AbstractHiddenItemDB (const QString loadFile) | |
Protected Attributes | |
| QVector< HiddenItemDBEntry * > | store |
| The loaded entries. | |
| const QString | loadFile |
| JSON asset path (set by the subclass). | |
Shared base for the two hidden-pickup databases (items and coins).
Hidden items and hidden coins are the same shape – a store of HiddenItemDBEntry loaded from a JSON file – so the common machinery (store, load, deepLink, QML accessors) lives here once. Subclasses (HiddenItemsDB, HiddenCoinsDB) just supply their loadFile (via the protected constructor), an inst(), and the concrete qmlRegister(). This is the one DB family using inheritance rather than the copy-the-pattern approach. See db.md.
Definition at line 35 of file abstracthiddenitemdb.h.
|
protected |
| loadFile | the JSON asset the concrete subclass loads from. |
Definition at line 98 of file abstracthiddenitemdb.cpp.
References load(), and loadFile.
Referenced by HiddenCoinsDB::HiddenCoinsDB(), HiddenItemsDB::HiddenItemsDB(), and qmlRegister().
| void AbstractHiddenItemDB::deepLink | ( | ) |
Resolve each entry's cross-DB links.
Definition at line 76 of file abstracthiddenitemdb.cpp.
References store.
| const QVector< HiddenItemDBEntry * > AbstractHiddenItemDB::getStore | ( | ) | const |
< Number of hidden pickups.
All hidden-pickup entries.
Definition at line 36 of file abstracthiddenitemdb.cpp.
References store.
| HiddenItemDBEntry * AbstractHiddenItemDB::getStoreAt | ( | const int | ind | ) | const |
Entry by store index (for QML).
Definition at line 46 of file abstracthiddenitemdb.cpp.
References store.
| int AbstractHiddenItemDB::getStoreSize | ( | ) | const |
| void AbstractHiddenItemDB::load | ( | ) |
Load entries from loadFile.
Definition at line 54 of file abstracthiddenitemdb.cpp.
References GameData::inst(), GameData::json(), loadFile, and store.
Referenced by AbstractHiddenItemDB().
| void AbstractHiddenItemDB::qmlProtect | ( | const QQmlEngine *const | engine | ) | const |
Pin to C++ ownership.
Definition at line 90 of file abstracthiddenitemdb.cpp.
References Utility::qmlProtectUtil(), and store.
Referenced by DB::qmlProtect().
|
protectedpure virtual |
Subclass registers its concrete type with QML.
Implemented in HiddenCoinsDB, and HiddenItemsDB.
References AbstractHiddenItemDB(), and loadFile.
|
protected |
JSON asset path (set by the subclass).
Definition at line 60 of file abstracthiddenitemdb.h.
Referenced by AbstractHiddenItemDB(), load(), and qmlRegister().
|
protected |
The loaded entries.
Definition at line 59 of file abstracthiddenitemdb.h.
Referenced by deepLink(), getStore(), getStoreAt(), getStoreSize(), load(), and qmlProtect().