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

The Game Corner database – prize entries plus the coin exchange rate. More...

#include <gamecornerdb.h>

Inheritance diagram for GameCornerDB:
Collaboration diagram for GameCornerDB:

Public Member Functions

const QVector< GameCornerDBEntry * > getStore () const
 All prize entries.
int getStoreSize () const
 Prize count.
GameCornerDBEntrygetStoreAt (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 GameCornerDBinst ()
 < Number of prize entries.

Friends

class GameCornerDBEntry
 Lets entries populate the store/price during load.

Detailed Description

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.

See also
GameCornerDBEntry, DB.

Definition at line 34 of file gamecornerdb.h.

Member Function Documentation

◆ deepLink()

void GameCornerDB::deepLink ( )

Resolve each prize's item/Pokemon links.

Definition at line 71 of file gamecornerdb.cpp.

◆ getBuyPrice()

◆ getSellPrice()

int GameCornerDB::getSellPrice ( ) const

◆ getStore()

const QVector< GameCornerDBEntry * > GameCornerDB::getStore ( ) const

All prize entries.

Definition at line 114 of file gamecornerdb.cpp.

◆ getStoreAt()

GameCornerDBEntry * GameCornerDB::getStoreAt ( const int ind) const

Prize by store index (for QML).

Definition at line 124 of file gamecornerdb.cpp.

References GameCornerDBEntry.

◆ getStoreSize()

int GameCornerDB::getStoreSize ( ) const

Prize count.

Definition at line 119 of file gamecornerdb.cpp.

◆ inst()

◆ load()

void GameCornerDB::load ( )

Load prizes from JSON.

Definition at line 36 of file gamecornerdb.cpp.

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

◆ qmlProtect()

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().

◆ GameCornerDBEntry

friend class GameCornerDBEntry
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().


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