Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
gamecornerdbentry.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 <QJsonValue>
20#include "../db_autoport.h"
21
22struct PokemonDBEntry;
23struct ItemDBEntry;
24class QQmlEngine;
25class GameCornerDB;
26
27
37struct DB_AUTOPORT GameCornerDBEntry : public QObject {
38 Q_OBJECT
39 Q_PROPERTY(QString getName READ getName CONSTANT)
40 Q_PROPERTY(QString getType READ getType CONSTANT)
41 Q_PROPERTY(int getPrice READ getPrice CONSTANT)
42 Q_PROPERTY(int getLevel READ getLevel CONSTANT)
43 Q_PROPERTY(PokemonDBEntry* getToPokemon READ getToPokemon CONSTANT)
44 Q_PROPERTY(ItemDBEntry* getToItem READ getToItem CONSTANT)
45
46public:
47 QString getName() const;
48 QString getType() const;
49 int getPrice() const;
50 int getLevel() const;
52 ItemDBEntry* getToItem() const;
53
54public slots:
55 void qmlProtect(const QQmlEngine* const engine) const;
56
57protected:
59 GameCornerDBEntry(const QJsonValue& data);
60 void deepLink();
61 void qmlRegister() const;
62
63 QString name = "";
64 QString type = "";
65 int price = 0;
66 int level = 0;
68 ItemDBEntry* toItem = nullptr;
69
70 friend class GameCornerDB;
71};
The Game Corner database – prize entries plus the coin exchange rate.
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 getType() const
void qmlRegister() const
Register with QML.
int price
Backing field (read via getPrice()).
PokemonDBEntry * toPokemon
Resolved Pokemon prize (deepLink).
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
QString getName() const
< Prize name.
void deepLink()
Resolve the Pokemon/item link.
int level
Backing field (read via getLevel()).
GameCornerDBEntry()
Empty entry (built by GameCornerDB).
friend class GameCornerDB
Owning DB constructs/populates entries.
PokemonDBEntry * getToPokemon() const
QString type
Backing field (read via getType()).
QString name
Backing field (read via getName()).
ItemDBEntry * getToItem() const
ItemDBEntry * toItem
Resolved item prize (deepLink).
One item's static data: name/flags, pricing, and where it's used.
Definition itemdbentry.h:46
One species' complete static data – the richest entry in the db layer.
Definition pokemon.h:98