|
Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
|
The Game Corner database – prize entries plus the coin exchange rate. More...
#include <gamecornerdb.h>
Public Member Functions | |
| const QVector< GameCornerDBEntry * > | getStore () const |
| All prize entries. | |
| int | getStoreSize () const |
| Prize count. | |
| GameCornerDBEntry * | getStoreAt (const int ind) const |
| Prize by store index (for QML). | |
| int | getBuyPrice () const |
The buy rate (backs getBuyPrice). | |
| int | getSellPrice () const |
| The sell rate (half the buy rate). | |
| void | load () |
| Load prizes from JSON. | |
| void | deepLink () |
| Resolve each prize's item/Pokemon links. | |
| void | qmlProtect (const QQmlEngine *const engine) const |
| Pin to C++ ownership. | |
Static Public Member Functions | |
| static GameCornerDB * | inst () |
| < Number of prize entries. | |
Friends | |
| class | GameCornerDBEntry |
| Lets entries populate the store/price during load. | |
The Game Corner database – prize entries plus the coin exchange rate.
Standard DB-singleton (see CreditsDB / db.md) with two extra rate properties: getBuyPrice / getSellPrice convert between Pokedollars and Game Coins. Per the note below, the sell-back follows the project's "half back" policy rather than an even exchange. The entry type is in entries/gamecornerdbentry.h.
Definition at line 34 of file gamecornerdb.h.
| void GameCornerDB::deepLink | ( | ) |
Resolve each prize's item/Pokemon links.
Definition at line 71 of file gamecornerdb.cpp.
| int GameCornerDB::getBuyPrice | ( | ) | const |
The buy rate (backs getBuyPrice).
Definition at line 132 of file gamecornerdb.cpp.
Referenced by ItemMarketEntryMoney::_itemWorth(), ItemDBEntry::buyPriceCoins(), ItemMarketEntryMoney::canCheckout(), ItemMarketModel::exchangeBuyRate(), ItemMarketEntryMoney::moneyDelta(), and ItemMarketEntryMoney::onCartLeft().
| int GameCornerDB::getSellPrice | ( | ) | const |
The sell rate (half the buy rate).
Definition at line 137 of file gamecornerdb.cpp.
Referenced by ItemMarketEntryMoney::_itemWorth(), ItemMarketModel::exchangeSellRate(), ItemMarketEntryMoney::moneyDelta(), and ItemMarketEntryMoney::onCartLeft().
| const QVector< GameCornerDBEntry * > GameCornerDB::getStore | ( | ) | const |
All prize entries.
Definition at line 114 of file gamecornerdb.cpp.
| GameCornerDBEntry * GameCornerDB::getStoreAt | ( | const int | ind | ) | const |
Prize by store index (for QML).
Definition at line 124 of file gamecornerdb.cpp.
References GameCornerDBEntry.
| int GameCornerDB::getStoreSize | ( | ) | const |
Prize count.
Definition at line 119 of file gamecornerdb.cpp.
|
static |
< Number of prize entries.
Coins-per-Pokedollar buy rate. Sell-back rate (half of buy; see note). The process-wide GameCornerDB singleton.
Definition at line 108 of file gamecornerdb.cpp.
Referenced by ItemMarketEntryMoney::_itemWorth(), ItemMarketModel::buildMartItemList(), ItemDBEntry::buyPriceCoins(), ItemMarketEntryMoney::canCheckout(), ItemMarketModel::exchangeBuyRate(), ItemMarketModel::exchangeSellRate(), DB::gameCorner(), GameCornerDBEntry::GameCornerDBEntry(), ItemMarketEntryMoney::moneyDelta(), ItemMarketEntryMoney::onCartLeft(), and DB::qmlProtect().
| void GameCornerDB::load | ( | ) |
Load prizes from JSON.
Definition at line 36 of file gamecornerdb.cpp.
References GameCornerDBEntry, GameData::inst(), and GameData::json().
| void GameCornerDB::qmlProtect | ( | const QQmlEngine *const | engine | ) | const |
Pin to C++ ownership.
Definition at line 85 of file gamecornerdb.cpp.
References Utility::qmlProtectUtil().
Referenced by DB::qmlProtect().
|
friend |
Lets entries populate the store/price during load.
Definition at line 74 of file gamecornerdb.h.
References GameCornerDBEntry.
Referenced by GameCornerDBEntry, getStoreAt(), and load().