Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
savefileexpanded.h
Go to the documentation of this file.
1/*
2 * Copyright 2019 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>
19
20#include "./player/player.h"
21#include "./area/area.h"
22#include "./world/world.h"
23#include "./storage.h"
24
25class SaveFile;
26class Player;
27class Area;
28class World;
29class Daycare;
30class HallOfFame;
31class Rival;
32class Storage;
33
57class SAVEFILE_AUTOPORT SaveFileExpanded : public QObject
58{
59 Q_OBJECT
60
61 Q_PROPERTY(Player* player MEMBER player NOTIFY playerChanged)
62 Q_PROPERTY(Area* area MEMBER area NOTIFY areaChanged)
63 Q_PROPERTY(World* world MEMBER world NOTIFY worldChanged)
64 Q_PROPERTY(Daycare* daycare MEMBER daycare NOTIFY daycareChanged)
65 Q_PROPERTY(HallOfFame* hof MEMBER hof NOTIFY hofChanged)
66 Q_PROPERTY(Rival* rival MEMBER rival NOTIFY rivalChanged)
67 Q_PROPERTY(Storage* storage MEMBER storage NOTIFY storageChanged)
68
69public:
70 SaveFileExpanded(SaveFile* saveFile = nullptr);
71 virtual ~SaveFileExpanded();
72
73 void load(SaveFile* saveFile = nullptr);
74 void save(SaveFile* saveFile);
75
76signals:
77 // No point in having these change signals but Q_PROPERTY requires them
78 void playerChanged();
82 void hofChanged();
85
86public slots:
87 void reset();
88 void randomize();
89
90public:
91 Player* player = nullptr;
92 Area* area = nullptr;
93 World* world = nullptr;
94 Daycare* daycare = nullptr;
95 HallOfFame* hof = nullptr;
96 Rival* rival = nullptr;
97 Storage* storage = nullptr;
98};
The current map's complete live state – everything about "where you are".
Definition area.h:82
The Day Care: at most one deposited Pokemon.
Definition daycare.h:42
The Hall of Fame: a rolling list of up to 50 winning-team records.
Definition halloffame.h:38
The trainer: their basics, bag, pokedex, and party.
Definition player.h:42
The rival: their name and chosen starter.
Definition rival.h:34
void save(SaveFile *saveFile)
Flatten: write the whole tree back into saveFile.
void randomize()
Constrained full randomization across the whole tree.
void reset()
Blank every region (acts like a fresh save's expansion).
SaveFileExpanded(SaveFile *saveFile=nullptr)
< The trainer: basics, items, pokedex, party.
void load(SaveFile *saveFile=nullptr)
Expand: build the whole tree from saveFile's raw bytes.
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition savefile.h:46
The PC: the item storage box and all 12 Pokemon boxes.
Definition storage.h:49
Global, map-independent game state – "the state of the world".
Definition world.h:50
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.