Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
mapdbentrywildmon.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#include "../db_autoport.h"
20
21class QQmlEngine;
22class MapsDB;
23class MapDBEntry;
24class PokemonDBEntry;
25
26// Wild Pokemon Entry
35struct DB_AUTOPORT MapDBEntryWildMon : public QObject {
36 Q_OBJECT
37 Q_PROPERTY(QString getName READ getName CONSTANT)
38 Q_PROPERTY(int getLevel READ getLevel CONSTANT)
39 Q_PROPERTY(PokemonDBEntry* getToPokemon READ getToPokemon CONSTANT)
40 Q_PROPERTY(MapDBEntry* getParent READ getParent CONSTANT)
41
42public:
43 const QString getName() const;
44 int getLevel() const;
46 MapDBEntry* getParent() const;
47
48public slots:
49 void qmlProtect(const QQmlEngine* const engine) const;
50
51protected:
53 MapDBEntryWildMon(const QJsonValue& value, MapDBEntry* const parent);
54 void deepLink();
55 void qmlRegister() const;
56
57 QString name = "";
58 int level = 0;
59
61 MapDBEntry* parent = nullptr;
62
63 friend class MapsDB;
64 friend class MapDBEntry;
65};
The maps database – every map and its full layout, keyed by name.
Definition mapsdb.h:41
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
void deepLink()
Resolve the species link.
friend class MapDBEntry
MapDBEntryWildMon()
Empty entry.
PokemonDBEntry * getToPokemon() const
MapDBEntry * parent
Owning map.
QString name
Species name.
PokemonDBEntry * toPokemon
Resolved species (deepLink).
const QString getName() const
< Species name.
void qmlRegister() const
Register with QML.
int level
Encounter level.
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
MapDBEntry * getParent() const
One map's complete static definition – the root of the MapDBEntry family.
Definition mapdbentry.h:56
One species' complete static data – the richest entry in the db layer.
Definition pokemon.h:98