Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
eventdbentry.h
Go to the documentation of this file.
1
/*
2
* Copyright 2020 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 <QJsonValue>
19
20
#include "
../db_autoport.h
"
21
22
struct
MapDBEntry
;
23
class
QQmlEngine;
24
class
EventsDB
;
25
26
// With amazing help of Quicktype!!!
27
// https://app.quicktype.io
28
29
// In-Game events, there's like a million of them, not kidding lol. Every little
30
// thing you do changes and moves around events
31
42
struct
DB_AUTOPORT
EventDBEntry
:
public
QObject {
43
Q_OBJECT
44
Q_PROPERTY(QString
getName
READ
getName
CONSTANT)
45
Q_PROPERTY(
int
getInd
READ
getInd
CONSTANT)
46
Q_PROPERTY(
int
getByte
READ
getByte
CONSTANT)
47
Q_PROPERTY(
int
getBit
READ
getBit
CONSTANT)
48
Q_PROPERTY(
int
getMapsSize
READ
getMapsSize
CONSTANT)
49
Q_PROPERTY(
int
getToMapsSize
READ
getToMapsSize
CONSTANT)
50
51
public
:
52
const
QString
getName
()
const
;
53
int
getInd
()
const
;
54
int
getByte
()
const
;
55
int
getBit
()
const
;
56
57
const
QVector<QString>
getMaps
()
const
;
58
int
getMapsSize
()
const
;
59
Q_INVOKABLE
const
QString
getMapAt
(
int
ind
)
const
;
60
61
const
QVector<MapDBEntry*>
getToMaps
()
const
;
62
int
getToMapsSize
()
const
;
63
Q_INVOKABLE
const
MapDBEntry
*
getToMapAt
(
int
ind
)
const
;
64
65
public
slots:
66
void
qmlProtect
(
const
QQmlEngine*
const
engine)
const
;
67
68
protected
:
69
EventDBEntry
();
70
EventDBEntry
(QJsonValue& data);
71
72
void
deepLink
();
73
void
qmlRegister
()
const
;
74
75
QString
name
=
""
;
// Event name
76
int
ind
= 0;
// Internal index
77
int
byte
= 0;
// Byte in SAV file
78
int
bit
= 0;
// Bit in byte
79
QVector<QString>
maps
;
// Associated Maps
80
QVector<MapDBEntry*>
toMaps
;
// To Associated Maps
81
82
friend
class
EventsDB
;
83
};
EventsDB
The story-events database – metadata for the 508 event flags, keyed by name.
Definition
eventsdb.h:41
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
EventDBEntry::EventDBEntry
EventDBEntry()
Empty entry (built by EventsDB).
Definition
eventdbentry.cpp:38
EventDBEntry::EventsDB
friend class EventsDB
Owning DB constructs/populates entries.
Definition
eventdbentry.h:82
EventDBEntry::getName
const QString getName() const
< Event name.
Definition
eventdbentry.cpp:137
EventDBEntry::name
QString name
Definition
eventdbentry.h:75
EventDBEntry::getMapAt
const QString getMapAt(int ind) const
Associated map name ind (for QML).
Definition
eventdbentry.cpp:114
EventDBEntry::bit
int bit
Definition
eventdbentry.h:78
EventDBEntry::getBit
int getBit() const
Definition
eventdbentry.cpp:122
EventDBEntry::getToMapsSize
int getToMapsSize() const
Definition
eventdbentry.cpp:86
EventDBEntry::qmlProtect
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
Definition
eventdbentry.cpp:99
EventDBEntry::qmlRegister
void qmlRegister() const
Register with QML.
Definition
eventdbentry.cpp:71
EventDBEntry::getMapsSize
int getMapsSize() const
Definition
eventdbentry.cpp:109
EventDBEntry::getMaps
const QVector< QString > getMaps() const
Associated map names.
Definition
eventdbentry.cpp:104
EventDBEntry::toMaps
QVector< MapDBEntry * > toMaps
Definition
eventdbentry.h:80
EventDBEntry::maps
QVector< QString > maps
Definition
eventdbentry.h:79
EventDBEntry::deepLink
void deepLink()
Resolve the associated maps.
Definition
eventdbentry.cpp:54
EventDBEntry::ind
int ind
Definition
eventdbentry.h:76
EventDBEntry::getInd
int getInd() const
Definition
eventdbentry.cpp:132
EventDBEntry::getToMaps
const QVector< MapDBEntry * > getToMaps() const
Resolved associated maps.
Definition
eventdbentry.cpp:81
EventDBEntry::getByte
int getByte() const
Definition
eventdbentry.cpp:127
EventDBEntry::getToMapAt
const MapDBEntry * getToMapAt(int ind) const
Resolved map ind (for QML).
Definition
eventdbentry.cpp:91
MapDBEntry
One map's complete static definition – the root of the MapDBEntry family.
Definition
mapdbentry.h:56
projects
db
src
pse-db
entries
eventdbentry.h
Generated by
1.17.0