|
Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
|
The items database – every item (with prices), keyed by name. More...
#include <itemsdb.h>
Public Member Functions | |
| const QVector< ItemDBEntry * > | getStore () const |
| All items. | |
| const QHash< QString, ItemDBEntry * > | getInd () const |
| Name->entry index. | |
| int | getStoreSize () const |
| Item count. | |
| ItemDBEntry * | getStoreAt (const int ind) const |
| Item by store index (for QML). | |
| ItemDBEntry * | getIndAt (const QString val) const |
| Item by name key (for QML). | |
| void | load () |
| Load items from JSON. | |
| void | index () |
| Build the name->entry index. | |
| void | deepLink () |
| Resolve each item's cross-DB links. | |
| void | qmlProtect (const QQmlEngine *const engine) const |
| Pin to C++ ownership. | |
Static Public Member Functions | |
| static ItemsDB * | inst () |
| < Number of items. | |
The items database – every item (with prices), keyed by name.
Standard DB-singleton with a name index and a deepLink() pass. See CreditsDB / db.md for the shared pattern; the entry type (with its buy/sell pricing) lives in entries/itemdbentry.h.
| void ItemsDB::deepLink | ( | ) |
Resolve each item's cross-DB links.
Definition at line 115 of file itemsdb.cpp.
| const QHash< QString, ItemDBEntry * > ItemsDB::getInd | ( | ) | const |
Name->entry index.
Definition at line 48 of file itemsdb.cpp.
Referenced by MapDBEntrySpriteItem::deepLink().
| ItemDBEntry * ItemsDB::getIndAt | ( | const QString | val | ) | const |
Item by name key (for QML).
Definition at line 66 of file itemsdb.cpp.
Referenced by GameCornerDBEntry::deepLink(), MoveDBEntry::deepLink(), PokemonDBEntry::deepLink(), PokemonDBEntryEvolution::deepLink(), TmHmsDB::deepLink(), ItemSelectModel::infoForInd(), Item::load(), and Item::toItem().
| const QVector< ItemDBEntry * > ItemsDB::getStore | ( | ) | const |
| ItemDBEntry * ItemsDB::getStoreAt | ( | const int | ind | ) | const |
Item by store index (for QML).
Definition at line 58 of file itemsdb.cpp.
| int ItemsDB::getStoreSize | ( | ) | const |
Item count.
Definition at line 53 of file itemsdb.cpp.
| void ItemsDB::index | ( | ) |
Build the name->entry index.
Definition at line 93 of file itemsdb.cpp.
|
static |
< Number of items.
The process-wide ItemsDB singleton.
Definition at line 37 of file itemsdb.cpp.
Referenced by ItemMarketModel::buildMartItemList(), GameCornerDBEntry::deepLink(), MapDBEntrySpriteItem::deepLink(), MoveDBEntry::deepLink(), PokemonDBEntry::deepLink(), PokemonDBEntryEvolution::deepLink(), TmHmsDB::deepLink(), ItemSelectModel::infoForInd(), DB::items(), ItemSelectModel::ItemSelectModel(), Item::load(), DB::qmlProtect(), Item::randomize(), ItemStorageBox::randomUniqueInd(), and Item::toItem().
| void ItemsDB::load | ( | ) |
Load items from JSON.
Definition at line 71 of file itemsdb.cpp.
References GameData::inst(), and GameData::json().
| void ItemsDB::qmlProtect | ( | const QQmlEngine *const | engine | ) | const |
Pin to C++ ownership.
Definition at line 129 of file itemsdb.cpp.
References Utility::qmlProtectUtil().
Referenced by DB::qmlProtect().