Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
world.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>
19
20#include "./worldother.h"
21
22class SaveFile;
23
24class WorldCompleted;
25class WorldEvents;
26class WorldGeneral;
27class WorldHidden;
28class WorldMissables;
29class WorldOther;
30class WorldScripts;
31class WorldTowns;
32class WorldTrades;
33class WorldLocal;
34
49class SAVEFILE_AUTOPORT World : public QObject
50{
51 Q_OBJECT
52
53 Q_PROPERTY(WorldCompleted* completed MEMBER completed NOTIFY completedChanged)
54 Q_PROPERTY(WorldEvents* events MEMBER events NOTIFY eventsChanged)
55 Q_PROPERTY(WorldGeneral* general MEMBER general NOTIFY generalChanged)
56 Q_PROPERTY(WorldHidden* hidden MEMBER hidden NOTIFY hiddenChanged)
57 Q_PROPERTY(WorldMissables* missables MEMBER missables NOTIFY missablesChanged)
58 Q_PROPERTY(WorldOther* other MEMBER other NOTIFY otherChanged)
59 Q_PROPERTY(WorldScripts* scripts MEMBER scripts NOTIFY scriptsChanged)
60 Q_PROPERTY(WorldTowns* towns MEMBER towns NOTIFY townsChanged)
61 Q_PROPERTY(WorldTrades* trades MEMBER trades NOTIFY tradesChanged)
62 Q_PROPERTY(WorldLocal* local MEMBER local NOTIFY localChanged)
63
64public:
65 World(SaveFile* saveFile = nullptr);
66 virtual ~World();
67
68 void load(SaveFile* saveFile = nullptr);
69 void save(SaveFile* saveFile);
70
71signals:
82
83public slots:
84 void reset();
85 void randomize();
86
87public:
89 WorldEvents* events = nullptr;
90 WorldGeneral* general = nullptr;
91 WorldHidden* hidden = nullptr;
93 WorldOther* other = nullptr;
94 WorldScripts* scripts = nullptr;
95 WorldTowns* towns = nullptr;
96 WorldTrades* trades = nullptr;
97 WorldLocal* local = nullptr;
98};
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition savefile.h:46
A handful of one-off "have you done X yet" milestone flags.
The game's story-event flags – a flat array of 508 booleans.
Definition worldevents.h:39
General world settings: last maps plus the Options / LetterDelay objects.
"Already collected" flags for hidden items and hidden Game Corner coins.
Definition worldhidden.h:42
A few map-specific puzzle/minigame state values.
Definition worldlocal.h:34
Visibility flags for "missable" sprites (one-time NPCs/items on maps).
Odds-and-ends world state: debug mode, the playtime clock, fossil results.
Definition worldother.h:83
Per-map script progress values (the in-progress state of each map's script).
"Visited" flags for towns – which fly destinations are unlocked.
Definition worldtowns.h:36
"Done" flags for the game's in-game (NPC) trades.
Definition worldtrades.h:36
WorldOther * other
Definition world.h:93
WorldScripts * scripts
Definition world.h:94
WorldMissables * missables
Definition world.h:92
WorldCompleted * completed
Definition world.h:88
void missablesChanged()
void generalChanged()
void scriptsChanged()
WorldLocal * local
Definition world.h:97
void load(SaveFile *saveFile=nullptr)
Expand all world regions from the save.
Definition world.cpp:65
void tradesChanged()
void randomize()
Randomize all world regions (constrained).
Definition world.cpp:110
WorldTrades * trades
Definition world.h:96
WorldTowns * towns
Definition world.h:95
void reset()
Blank all world regions.
Definition world.cpp:96
protected::void completedChanged()
void hiddenChanged()
WorldGeneral * general
Definition world.h:90
void localChanged()
void otherChanged()
void save(SaveFile *saveFile)
Flatten all world regions to the save.
Definition world.cpp:82
WorldEvents * events
Definition world.h:89
World(SaveFile *saveFile=nullptr)
< Completion milestones.
Definition world.cpp:35
WorldHidden * hidden
Definition world.h:91
void townsChanged()
void eventsChanged()
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.