Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
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
>
19
#include "
../../savefile_autoport.h
"
20
21
class
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
26
constexpr
var16
eventCount
= 508;
27
38
class
SAVEFILE_AUTOPORT
WorldEvents
:
public
QObject
39
{
40
Q_OBJECT
41
42
public
:
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
50
signals:
51
void
completedEventsChanged
();
52
53
public
slots:
54
void
load
(
SaveFile
* saveFile =
nullptr
);
55
void
save
(
SaveFile
* saveFile);
56
void
reset
();
57
void
randomize
();
58
59
public
:
60
bool
completedEvents
[
eventCount
];
61
};
SaveFile
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition
savefile.h:46
WorldEvents::reset
void reset()
Clear every event.
Definition
worldevents.cpp:83
WorldEvents::eventsSet
void eventsSet(int ind, bool val)
Set/clear event ind.
Definition
worldevents.cpp:50
WorldEvents::load
void load(SaveFile *saveFile=nullptr)
Expand all event bits from the save.
Definition
worldevents.cpp:56
WorldEvents::eventsAt
bool eventsAt(int ind)
Is event ind set?
Definition
worldevents.cpp:45
WorldEvents::completedEventsChanged
protected::void completedEventsChanged()
WorldEvents::WorldEvents
WorldEvents(SaveFile *saveFile=nullptr)
Definition
worldevents.cpp:33
WorldEvents::randomize
void randomize()
Randomize the event flags.
Definition
worldevents.cpp:92
WorldEvents::save
void save(SaveFile *saveFile)
Flatten all event bits to the save.
Definition
worldevents.cpp:73
WorldEvents::completedEvents
bool completedEvents[eventCount]
One flag per known story event.
Definition
worldevents.h:60
WorldEvents::eventsCount
int eventsCount()
Number of event flags (eventCount).
Definition
worldevents.cpp:40
types.h
Project-wide fixed-width integer aliases (var8, var16, ...).
var16
var16e var16
Everyday 16-bit alias. Exact width to avoid the "fastest" widening bug.
Definition
types.h:125
savefile_autoport.h
Import/export macro for the savefile library, plus the central list of QObject types kept deliberatel...
SAVEFILE_AUTOPORT
#define SAVEFILE_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.
Definition
savefile_autoport.h:38
eventCount
constexpr var16 eventCount
Number of known story-event flags (scattered across the save).
Definition
worldevents.h:26
projects
savefile
src
pse-savefile
expanded
world
worldevents.h
Generated by
1.17.0