Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
rival.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 <pse-common/types.h>
21
22class SaveFile;
23
33class SAVEFILE_AUTOPORT Rival : public QObject
34{
35 Q_OBJECT
36
37 Q_PROPERTY(QString name MEMBER name NOTIFY nameChanged)
38 Q_PROPERTY(int starter MEMBER starter NOTIFY starterChanged)
39
40public:
41 Rival(SaveFile* saveFile = nullptr);
42 virtual ~Rival();
43
44 void load(SaveFile* saveFile = nullptr);
45 void save(SaveFile* saveFile);
46
47signals:
50
51public slots:
52 void reset();
53 void randomize();
54
55public:
56 // Rival's Name and Starter Pokemon
57 // This essentially selects his team that he uses to battle you, it goes
58 // by internal Pokemon index and only 3 options are valid, Charmander,
59 // Bulbasaur, and Squirtle. I have no idea what will happen if you put a
60 // different value in here.
61 QString name;
62 int starter;
63};
void reset()
Blank the rival.
Definition rival.cpp:61
void save(SaveFile *saveFile)
Flatten the rival data to the save.
Definition rival.cpp:53
QString name
Definition rival.h:61
int starter
Definition rival.h:62
Rival(SaveFile *saveFile=nullptr)
< Rival's name.
Definition rival.cpp:30
protected::void nameChanged()
void starterChanged()
void randomize()
Randomize the rival's name/starter.
Definition rival.cpp:70
void load(SaveFile *saveFile=nullptr)
Expand the rival data from the save.
Definition rival.cpp:37
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition savefile.h:46
Project-wide fixed-width integer aliases (var8, var16, ...).
Import/export macro for the savefile library, plus the central list of QObject types kept deliberatel...
#define SAVEFILE_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.