Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
mapdbentryspritetrainer.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 "./mapdbentrysprite.h"
18
19class TrainerDBEntry;
20class MapsDB;
21
22// A trainer that can be battled
32{
33 Q_OBJECT
34 Q_PROPERTY(QString getTrainerClass READ getTrainerClass CONSTANT)
35 Q_PROPERTY(int getTeam READ getTeam CONSTANT)
36 Q_PROPERTY(TrainerDBEntry* getToTrainer READ getToTrainer CONSTANT)
37
38public:
39 virtual SpriteType type() const;
40 const QString getTrainerClass() const;
41 int getTeam() const;
43
44protected:
45 MapDBEntrySpriteTrainer(const QJsonValue& data, MapDBEntry* const parent);
46 virtual void deepLink();
47 virtual void qmlRegister() const;
48
49 // Trainer Details
50 // What kind of trainer and which team
51 QString trainerClass = "";
52 int team = -1;
53
55
56 friend class MapsDB;
57 friend class MapDBEntry;
58};
The maps database – every map and its full layout, keyed by name.
Definition mapsdb.h:41
#define DB_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.
Definition db_autoport.h:37
QString trainerClass
Trainer class name (read via getTrainerClass()).
TrainerDBEntry * toTrainer
Resolved trainer class (deepLink).
MapDBEntrySpriteTrainer(const QJsonValue &data, MapDBEntry *const parent)
Build from JSON under parent.
const QString getTrainerClass() const
TrainerDBEntry * getToTrainer() const
MapDBEntrySprite()
Empty entry.
virtual void deepLink()
Resolve sprite/missable links.
virtual SpriteType type() const
The sprite kind (overridden by subclasses).
virtual void qmlRegister() const
Register with QML.
MapDBEntry * parent
Owning map.
SpriteType
< X adjusted for Gen 1 placement.
One trainer-class definition (its name/index and flags).
Definition trainers.h:38