Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
worldevents.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 <pse-common/types.h>
20
21class SaveFile;
22
23// Total number of known events
24// We can't break this down into a byte count because these bits
25// have to be gotten all over the place
26constexpr var16 eventCount = 508;
27
38class SAVEFILE_AUTOPORT WorldEvents : public QObject
39{
40 Q_OBJECT
41
42public:
43 WorldEvents(SaveFile* saveFile = nullptr);
44 virtual ~WorldEvents();
45
46 Q_INVOKABLE int eventsCount();
47 Q_INVOKABLE bool eventsAt(int ind);
48 Q_INVOKABLE void eventsSet(int ind, bool val);
49
50signals:
52
53public slots:
54 void load(SaveFile* saveFile = nullptr);
55 void save(SaveFile* saveFile);
56 void reset();
57 void randomize();
58
59public:
61};
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition savefile.h:46
void reset()
Clear every event.
void eventsSet(int ind, bool val)
Set/clear event ind.
void load(SaveFile *saveFile=nullptr)
Expand all event bits from the save.
bool eventsAt(int ind)
Is event ind set?
protected::void completedEventsChanged()
WorldEvents(SaveFile *saveFile=nullptr)
void randomize()
Randomize the event flags.
void save(SaveFile *saveFile)
Flatten all event bits to the save.
bool completedEvents[eventCount]
One flag per known story event.
Definition worldevents.h:60
int eventsCount()
Number of event flags (eventCount).
Project-wide fixed-width integer aliases (var8, var16, ...).
var16e var16
Everyday 16-bit alias. Exact width to avoid the "fastest" widening bug.
Definition types.h:125
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.
constexpr var16 eventCount
Number of known story-event flags (scattered across the save).
Definition worldevents.h:26