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

The items database – every item (with prices), keyed by name. More...

#include <itemsdb.h>

Inheritance diagram for ItemsDB:
Collaboration diagram for ItemsDB:

Public Member Functions

const QVector< ItemDBEntry * > getStore () const
 All items.
const QHash< QString, ItemDBEntry * > getInd () const
 Name->entry index.
int getStoreSize () const
 Item count.
ItemDBEntrygetStoreAt (const int ind) const
 Item by store index (for QML).
ItemDBEntrygetIndAt (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 ItemsDBinst ()
 < Number of items.

Detailed Description

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.

See also
ItemDBEntry, DB.

Definition at line 35 of file itemsdb.h.

Member Function Documentation

◆ deepLink()

void ItemsDB::deepLink ( )

Resolve each item's cross-DB links.

Definition at line 115 of file itemsdb.cpp.

◆ getInd()

const QHash< QString, ItemDBEntry * > ItemsDB::getInd ( ) const

Name->entry index.

Definition at line 48 of file itemsdb.cpp.

Referenced by MapDBEntrySpriteItem::deepLink().

◆ getIndAt()

◆ getStore()

const QVector< ItemDBEntry * > ItemsDB::getStore ( ) const

All items.

Definition at line 43 of file itemsdb.cpp.

Referenced by Item::randomize().

◆ getStoreAt()

ItemDBEntry * ItemsDB::getStoreAt ( const int ind) const

Item by store index (for QML).

Definition at line 58 of file itemsdb.cpp.

◆ getStoreSize()

int ItemsDB::getStoreSize ( ) const

Item count.

Definition at line 53 of file itemsdb.cpp.

◆ index()

void ItemsDB::index ( )

Build the name->entry index.

Definition at line 93 of file itemsdb.cpp.

◆ inst()

◆ load()

void ItemsDB::load ( )

Load items from JSON.

Definition at line 71 of file itemsdb.cpp.

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

◆ qmlProtect()

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


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