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

The map-scripts database, keyed by name. More...

#include <scripts.h>

Inheritance diagram for ScriptsDB:
Collaboration diagram for ScriptsDB:

Public Member Functions

const QVector< ScriptDBEntry * > getStore () const
 All scripts.
const QHash< QString, ScriptDBEntry * > getInd () const
 Name->entry index.
int getStoreSize () const
 Script count.
ScriptDBEntrygetStoreAt (int idx) const
 Script by store index (for QML).
ScriptDBEntrygetIndAt (const QString &key) const
 Script by name key (for QML).
void load ()
 Load scripts from JSON.
void index ()
 Build the name->entry index.
void deepLink ()
 Resolve each script's map links.
void qmlProtect (const QQmlEngine *const engine) const
 Pin to C++ ownership.

Static Public Member Functions

static ScriptsDBinst ()
 < Number of scripts.

Detailed Description

The map-scripts database, keyed by name.

Standard DB-singleton with a name index and a deepLink() pass. See db.md.

See also
ScriptDBEntry, DB.

Definition at line 62 of file scripts.h.

Member Function Documentation

◆ deepLink()

void ScriptsDB::deepLink ( )

Resolve each script's map links.

Definition at line 109 of file scripts.cpp.

◆ getInd()

const QHash< QString, ScriptDBEntry * > ScriptsDB::getInd ( ) const
nodiscard

Name->entry index.

Definition at line 74 of file scripts.cpp.

◆ getIndAt()

ScriptDBEntry * ScriptsDB::getIndAt ( const QString & key) const

Script by name key (for QML).

Definition at line 83 of file scripts.cpp.

◆ getStore()

const QVector< ScriptDBEntry * > ScriptsDB::getStore ( ) const
nodiscard

All scripts.

Definition at line 73 of file scripts.cpp.

◆ getStoreAt()

ScriptDBEntry * ScriptsDB::getStoreAt ( int idx) const

Script by store index (for QML).

Definition at line 77 of file scripts.cpp.

◆ getStoreSize()

int ScriptsDB::getStoreSize ( ) const
nodiscard

Script count.

Definition at line 75 of file scripts.cpp.

◆ index()

void ScriptsDB::index ( )

Build the name->entry index.

Definition at line 98 of file scripts.cpp.

◆ inst()

ScriptsDB * ScriptsDB::inst ( )
static

< Number of scripts.

The process-wide ScriptsDB singleton.

Definition at line 67 of file scripts.cpp.

Referenced by WorldScripts::load(), DB::qmlProtect(), WorldScripts::save(), and DB::scripts().

◆ load()

void ScriptsDB::load ( )

Load scripts from JSON.

Definition at line 88 of file scripts.cpp.

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

◆ qmlProtect()

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

Pin to C++ ownership.

Definition at line 118 of file scripts.cpp.

References Utility::qmlProtectUtil().

Referenced by DB::qmlProtect().


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