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

The sprites database, keyed by name. More...

#include <sprites.h>

Inheritance diagram for SpritesDB:
Collaboration diagram for SpritesDB:

Public Member Functions

const QVector< SpriteDBEntry * > getStore () const
 All sprites.
const QHash< QString, SpriteDBEntry * > getInd () const
 Name->entry index.
int getStoreSize () const
 Sprite count.
SpriteDBEntrygetStoreAt (int idx) const
 Sprite by store index (for QML).
SpriteDBEntrygetIndAt (const QString &key) const
 Sprite by name key (for QML).
void load ()
 Load sprites from JSON.
void index ()
 Build the name->entry index.
void qmlProtect (const QQmlEngine *const engine) const
 Pin to C++ ownership.

Static Public Member Functions

static SpritesDBinst ()
 < Number of sprites.

Detailed Description

The sprites database, keyed by name.

Standard DB-singleton with a name index (see CreditsDB / db.md).

See also
SpriteDBEntry, DB.

Definition at line 55 of file sprites.h.

Member Function Documentation

◆ getInd()

const QHash< QString, SpriteDBEntry * > SpritesDB::getInd ( ) const
nodiscard

Name->entry index.

Definition at line 43 of file sprites.cpp.

◆ getIndAt()

SpriteDBEntry * SpritesDB::getIndAt ( const QString & key) const

Sprite by name key (for QML).

Definition at line 52 of file sprites.cpp.

Referenced by MapDBEntrySprite::deepLink(), SpriteSetDBEntry::deepLink(), and SpriteData::toSprite().

◆ getStore()

const QVector< SpriteDBEntry * > SpritesDB::getStore ( ) const
nodiscard

All sprites.

Definition at line 42 of file sprites.cpp.

Referenced by SpriteData::randomize().

◆ getStoreAt()

SpriteDBEntry * SpritesDB::getStoreAt ( int idx) const

Sprite by store index (for QML).

Definition at line 46 of file sprites.cpp.

◆ getStoreSize()

int SpritesDB::getStoreSize ( ) const
nodiscard

Sprite count.

Definition at line 44 of file sprites.cpp.

◆ index()

void SpritesDB::index ( )

Build the name->entry index.

Definition at line 67 of file sprites.cpp.

◆ inst()

SpritesDB * SpritesDB::inst ( )
static

< Number of sprites.

The process-wide SpritesDB singleton.

Definition at line 36 of file sprites.cpp.

Referenced by MapDBEntrySprite::deepLink(), SpriteSetDBEntry::deepLink(), DB::qmlProtect(), SpriteData::randomize(), DB::sprites(), and SpriteData::toSprite().

◆ load()

void SpritesDB::load ( )

Load sprites from JSON.

Definition at line 57 of file sprites.cpp.

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

◆ qmlProtect()

void SpritesDB::qmlProtect ( const QQmlEngine *const engine) const

Pin to C++ ownership.

Definition at line 78 of file sprites.cpp.

References Utility::qmlProtectUtil().

Referenced by DB::qmlProtect().


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