Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
mapdbentrysprite.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 "
../db_autoport.h
"
19
20
class
MapDBEntry
;
21
class
MissableDBEntry
;
22
class
SpriteDBEntry
;
23
class
QQmlEngine;
24
class
MapsDB
;
25
26
// Sprites are a tad complicated only becuase there are different kinds of
27
// sprites having different set of options and all rolled into one data set.
28
// Sprites are the 2nd most complicated data structure mainly because sprite
29
// data is all over the place and in so many different forms and variables
30
// it's actually a very messy system because it feels like this is one area
31
// the developers were most trying to figure out through development.
43
struct
DB_AUTOPORT
MapDBEntrySprite
:
public
QObject
44
{
45
Q_OBJECT
46
Q_PROPERTY(
int
adjustedX
READ
adjustedX
CONSTANT)
47
Q_PROPERTY(
int
adjustedY
READ
adjustedY
CONSTANT)
48
Q_PROPERTY(
SpriteType
type
READ
type
CONSTANT)
49
Q_PROPERTY(QString
getSprite
READ
getSprite
CONSTANT)
50
Q_PROPERTY(
int
getX
READ
getX
CONSTANT)
51
Q_PROPERTY(
int
getY
READ
getY
CONSTANT)
52
Q_PROPERTY(QString
getMove
READ
getMove
CONSTANT)
53
Q_PROPERTY(
int
getText
READ
getText
CONSTANT)
54
Q_PROPERTY(
int
getRange
READ
getRange
CONSTANT)
55
Q_PROPERTY(QString
getFace
READ
getFace
CONSTANT)
56
Q_PROPERTY(
int
getMissable
READ
getMissable
CONSTANT)
57
Q_PROPERTY(
MissableDBEntry
*
getToMissable
READ
getToMissable
CONSTANT)
58
Q_PROPERTY(
SpriteDBEntry
*
getToSprite
READ
getToSprite
CONSTANT)
59
Q_PROPERTY(
MapDBEntry
*
getParent
READ
getParent
CONSTANT)
60
61
public
:
62
// Details on all the maps in the game
63
65
enum
SpriteType
66
{
67
// The sprite is a simple NPC
68
NPC
,
69
70
// The sprite is an item that can be obtained
71
ITEM
,
72
73
// The sprite is a one-time Pokemon that can be battled and beaten
74
POKEMON
,
75
76
// The sprite is a trainer which has a team that can be battled and beaten
77
TRAINER
,
78
79
// There's no child class for some reason, your asking the parent who doesn't
80
// know
81
ERROR
82
};
83
Q_ENUM(SpriteType)
84
85
// X & Y Coordinates adjusted for the gen 1 games
86
int
adjustedX()
const
;
87
int
adjustedY()
const
;
88
virtual
SpriteType type()
const
;
89
const
QString getSprite()
const
;
90
int
getX()
const
;
91
int
getY()
const
;
92
const
QString getMove()
const
;
93
int
getText()
const
;
94
int
getRange()
const
;
95
const
QString getFace()
const
;
96
int
getMissable()
const
;
97
MissableDBEntry
* getToMissable()
const
;
98
SpriteDBEntry
* getToSprite()
const
;
99
MapDBEntry
* getParent()
const
;
100
101
public
slots:
102
void
qmlProtect(
const
QQmlEngine*
const
engine)
const
;
103
104
protected
:
105
MapDBEntrySprite
();
106
MapDBEntrySprite
(
const
QJsonValue& data,
MapDBEntry
*
const
parent);
107
virtual
void
deepLink();
108
virtual
void
qmlRegister()
const
;
109
110
// Name of sprite
111
QString
sprite
;
112
113
// X & Y position on map
114
int
x
= 0;
115
int
y
= 0;
116
117
// Whether the sprite is moving or remaining still
118
// Walk, Stay
119
// The game only uses those 2 options but if a 3rd value is present it will
120
// move without collision detection
121
QString
move
=
""
;
122
123
// Text when interacting with sprite
124
int
text
= -1;
125
126
// Is the sprite allowed room to move?
127
// Or is it given a static facing position
128
// Only one or the other can be filled in, not both
129
int
range
= -1;
130
QString
face
=
""
;
131
132
// Is this sprite a missable, if so to which missable?
133
int
missable
= -1;
134
MissableDBEntry
*
toMissable
=
nullptr
;
135
136
// To Sprite
137
SpriteDBEntry
*
toSprite
=
nullptr
;
138
139
// Parent Map Entry
140
MapDBEntry
*
parent
=
nullptr
;
141
142
friend
class
MapsDB
;
143
friend
class
MapDBEntry
;
144
};
MapsDB
The maps database – every map and its full layout, keyed by name.
Definition
mapsdb.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
MapDBEntrySprite
A map's sprite definition – base class for the four sprite kinds.
Definition
mapdbentrysprite.h:44
MapDBEntrySprite::toMissable
MissableDBEntry * toMissable
Resolved missable (deepLink).
Definition
mapdbentrysprite.h:134
MapDBEntrySprite::getRange
int getRange() const
Definition
mapdbentrysprite.cpp:118
MapDBEntrySprite::text
int text
Interaction text id.
Definition
mapdbentrysprite.h:124
MapDBEntrySprite::MapDBEntry
friend class MapDBEntry
Definition
mapdbentrysprite.h:143
MapDBEntrySprite::range
int range
Wander range (exclusive with face).
Definition
mapdbentrysprite.h:129
MapDBEntrySprite::getToMissable
MissableDBEntry * getToMissable() const
Definition
mapdbentrysprite.cpp:103
MapDBEntrySprite::MapDBEntrySprite
MapDBEntrySprite()
Empty entry.
Definition
mapdbentrysprite.cpp:31
MapDBEntrySprite::MapsDB
friend class MapsDB
Definition
mapdbentrysprite.h:142
MapDBEntrySprite::type
virtual SpriteType type() const
The sprite kind (overridden by subclasses).
Definition
mapdbentrysprite.cpp:149
MapDBEntrySprite::getMove
const QString getMove() const
Definition
mapdbentrysprite.cpp:128
MapDBEntrySprite::adjustedX
int adjustedX() const
Definition
mapdbentrysprite.cpp:157
MapDBEntrySprite::x
int x
Raw X.
Definition
mapdbentrysprite.h:114
MapDBEntrySprite::sprite
QString sprite
Sprite name (read via getSprite()).
Definition
mapdbentrysprite.h:111
MapDBEntrySprite::parent
MapDBEntry * parent
Owning map.
Definition
mapdbentrysprite.h:140
MapDBEntrySprite::getY
int getY() const
Definition
mapdbentrysprite.cpp:133
MapDBEntrySprite::face
QString face
Static facing (exclusive with range).
Definition
mapdbentrysprite.h:130
MapDBEntrySprite::getMissable
int getMissable() const
Definition
mapdbentrysprite.cpp:108
MapDBEntrySprite::getParent
MapDBEntry * getParent() const
Definition
mapdbentrysprite.cpp:88
MapDBEntrySprite::getSprite
const QString getSprite() const
Definition
mapdbentrysprite.cpp:143
MapDBEntrySprite::y
int y
Raw Y.
Definition
mapdbentrysprite.h:115
MapDBEntrySprite::missable
int missable
Missable index, or -1.
Definition
mapdbentrysprite.h:133
MapDBEntrySprite::getX
int getX() const
Definition
mapdbentrysprite.cpp:138
MapDBEntrySprite::toSprite
SpriteDBEntry * toSprite
Resolved sprite picture (deepLink).
Definition
mapdbentrysprite.h:137
MapDBEntrySprite::move
QString move
Movement mode (see note).
Definition
mapdbentrysprite.h:121
MapDBEntrySprite::getFace
const QString getFace() const
Definition
mapdbentrysprite.cpp:113
MapDBEntrySprite::adjustedY
int adjustedY() const
Definition
mapdbentrysprite.cpp:162
MapDBEntrySprite::getToSprite
SpriteDBEntry * getToSprite() const
Definition
mapdbentrysprite.cpp:98
MapDBEntrySprite::getText
int getText() const
Definition
mapdbentrysprite.cpp:123
MapDBEntrySprite::SpriteType
SpriteType
< X adjusted for Gen 1 placement.
Definition
mapdbentrysprite.h:66
MapDBEntrySprite::ERROR
@ ERROR
Definition
mapdbentrysprite.h:81
MapDBEntrySprite::POKEMON
@ POKEMON
Definition
mapdbentrysprite.h:74
MapDBEntrySprite::ITEM
@ ITEM
Definition
mapdbentrysprite.h:71
MapDBEntrySprite::NPC
@ NPC
Definition
mapdbentrysprite.h:68
MapDBEntrySprite::TRAINER
@ TRAINER
Definition
mapdbentrysprite.h:77
MapDBEntry
One map's complete static definition – the root of the MapDBEntry family.
Definition
mapdbentry.h:56
MissableDBEntry
One missable definition: a script/sprite that can be hidden or shown.
Definition
missabledbentry.h:51
SpriteDBEntry
One sprite definition: its name/picture-id and the maps that use it.
Definition
sprites.h:38
projects
db
src
pse-db
entries
mapdbentrysprite.h
Generated by
1.17.0