Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
missablesdb.h
Go to the documentation of this file.
1
/*
2
* Copyright 2019 Twilight
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
#pragma once
17
#include <QObject>
18
#include <QVector>
19
#include <QHash>
20
21
#include "
./db_autoport.h
"
22
23
class
MissableDBEntry
;
24
class
QQmlEngine;
25
35
class
DB_AUTOPORT
MissablesDB :
public
QObject
36
{
37
Q_OBJECT
38
Q_PROPERTY(
int
getStoreSize
READ
getStoreSize
CONSTANT)
39
40
public
:
41
// Get Instance
42
static
MissablesDB*
inst
();
43
44
// Get Properties, includes QML array helpers
45
const
QVector<MissableDBEntry*>
getStore
()
const
;
46
const
QHash<QString, MissableDBEntry*>
getInd
()
const
;
47
int
getStoreSize
()
const
;
48
49
// QML Methods that can't be a property or slot because they take an argument
50
Q_INVOKABLE
MissableDBEntry
*
getStoreAt
(
const
int
ind)
const
;
51
Q_INVOKABLE
MissableDBEntry
*
getIndAt
(
const
QString val)
const
;
52
53
public
slots:
54
void
load
();
55
void
index
();
56
void
deepLink
();
57
void
qmlProtect
(
const
QQmlEngine*
const
engine)
const
;
58
59
private
slots:
60
void
qmlRegister()
const
;
61
62
private
:
63
// Singleton Constructor
64
MissablesDB();
65
66
QVector<MissableDBEntry*> store;
67
QHash<QString, MissableDBEntry*> ind;
68
};
MissablesDB::getStoreSize
int getStoreSize() const
Missable count.
Definition
missablesdb.cpp:46
MissablesDB::qmlProtect
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
Definition
missablesdb.cpp:118
MissablesDB::index
void index()
Build the name->entry index.
Definition
missablesdb.cpp:86
MissablesDB::deepLink
void deepLink()
Resolve each missable's cross-DB links.
Definition
missablesdb.cpp:104
MissablesDB::getInd
const QHash< QString, MissableDBEntry * > getInd() const
Name->entry index.
Definition
missablesdb.cpp:41
MissablesDB::getIndAt
MissableDBEntry * getIndAt(const QString val) const
Missable by name key (for QML).
Definition
missablesdb.cpp:59
MissablesDB::getStore
const QVector< MissableDBEntry * > getStore() const
All missable definitions.
Definition
missablesdb.cpp:36
MissablesDB::getStoreAt
MissableDBEntry * getStoreAt(const int ind) const
Missable by store index (for QML).
Definition
missablesdb.cpp:51
MissablesDB::inst
static MissablesDB * inst()
< Number of missable definitions.
Definition
missablesdb.cpp:30
MissablesDB::load
void load()
Load missables from JSON.
Definition
missablesdb.cpp:64
db_autoport.h
Import/export macro for the db library, plus the central list of DB entry pointer types declared opaq...
DB_AUTOPORT
#define DB_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.
Definition
db_autoport.h:37
MissableDBEntry
One missable definition: a script/sprite that can be hidden or shown.
Definition
missabledbentry.h:51
projects
db
src
pse-db
missablesdb.h
Generated by
1.17.0