Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
eventpokemondbentry.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 <QString>
19#include <QVector>
20#include <optional>
21#include "../db_autoport.h"
22
23struct PokemonDBEntry;
24class QQmlEngine;
25class EventPokemonDB;
26
27
37struct DB_AUTOPORT EventPokemonDBEntry : public QObject {
38 Q_OBJECT
39 Q_PROPERTY(QString getTitle READ getTitle CONSTANT)
40 Q_PROPERTY(QString getDesc READ getDesc CONSTANT)
41 Q_PROPERTY(QString getPokemon READ getPokemon CONSTANT)
42 Q_PROPERTY(QString getRegion READ getRegion CONSTANT)
43 Q_PROPERTY(PokemonDBEntry* getToPokemon READ getToPokemon CONSTANT)
44 Q_PROPERTY(int getOtId READ getOtId CONSTANT)
45 Q_PROPERTY(int getDvAtk READ getDvAtk CONSTANT)
46 Q_PROPERTY(int getDvDef READ getDvDef CONSTANT)
47 Q_PROPERTY(int getDvSpd READ getDvSpd CONSTANT)
48 Q_PROPERTY(int getDvSp READ getDvSp CONSTANT)
49 Q_PROPERTY(int getLevel READ getLevel CONSTANT)
50
51public:
52 QString getTitle() const;
53 QString getDesc() const;
54 QString getPokemon() const;
55 QVector<QString> getOtName() const;
56 QString getRegion() const;
57 QVector<QString> getMoves() const;
59 int getLevel() const;
60 int getOtId() const;
61 int getDvAtk() const;
62 int getDvDef() const;
63 int getDvSpd() const;
64 int getDvSp() const;
65
66public slots:
67 void qmlProtect(const QQmlEngine* const engine) const;
68
69protected slots:
70 void qmlRegister() const;
71
72protected:
74 EventPokemonDBEntry(const QJsonValue& data);
75 void deepLink();
76
77 QString title = "";
78 QString desc = "";
79 QString pokemon = "";
80 QVector<QString> otName;
81 QString region = "";
82 QVector<QString> moves;
83 int level = -1;
84 int otId = -1;
85 int dvAtk = -1;
86 int dvDef = -1;
87 int dvSpd = -1;
88 int dvSp = -1;
90
91 friend class EventPokemonDB;
92};
Database of real-world event/distribution Pokemon presets.
Import/export macro for the db library, plus the central list of DB entry pointer types declared opaq...
#define DB_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.
Definition db_autoport.h:37
QString region
Backing field (read via getRegion()).
friend class EventPokemonDB
Owning DB constructs/populates entries.
QVector< QString > otName
OT-name options (read via getOtName()).
QString pokemon
Backing field (read via getPokemon()).
PokemonDBEntry * getToPokemon() const
void deepLink()
Resolve the species link.
int dvAtk
Backing field (read via getDvAtk()).
QVector< QString > moves
Move names (read via getMoves()).
int dvSp
Backing field (read via getDvSp()).
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
QString title
Backing field (read via getTitle()).
PokemonDBEntry * toPokemon
Resolved species (deepLink).
int dvDef
Backing field (read via getDvDef()).
QVector< QString > getOtName() const
OT-name options.
int otId
Backing field (read via getOtId()).
QVector< QString > getMoves() const
Move names the mon comes with.
QString desc
Backing field (read via getDesc()).
int level
Backing field (read via getLevel()).
EventPokemonDBEntry()
Empty entry (built by EventPokemonDB).
void qmlRegister() const
Register with QML.
QString getTitle() const
< Distribution title.
int dvSpd
Backing field (read via getDvSpd()).
One species' complete static data – the richest entry in the db layer.
Definition pokemon.h:98