Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
worldtowns.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
constexpr
var8
townCount
= 11;
24
constexpr
var8
townByteCount
= 2;
25
35
class
SAVEFILE_AUTOPORT
WorldTowns
:
public
QObject
36
{
37
Q_OBJECT
38
39
public
:
40
WorldTowns
(
SaveFile
* saveFile =
nullptr
);
41
virtual
~WorldTowns
();
42
43
void
load
(
SaveFile
* saveFile =
nullptr
);
44
void
save
(
SaveFile
* saveFile);
45
46
Q_INVOKABLE
int
townsCount
();
47
Q_INVOKABLE
bool
townsAt
(
int
ind);
48
Q_INVOKABLE
void
townsSet
(
int
ind,
bool
val);
49
50
signals:
51
void
visitedTownsChanged
();
52
53
public
slots:
54
void
reset
();
55
void
randomize
();
56
57
public
:
58
bool
visitedTowns
[
townCount
];
59
};
SaveFile
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition
savefile.h:46
WorldTowns::randomize
void randomize()
Randomize the visited flags.
Definition
worldtowns.cpp:90
WorldTowns::visitedTowns
bool visitedTowns[townCount]
Per-town visited (fly-unlocked) flags.
Definition
worldtowns.h:58
WorldTowns::townsAt
bool townsAt(int ind)
Is town ind visited (fly-unlocked)?
Definition
worldtowns.cpp:73
WorldTowns::WorldTowns
WorldTowns(SaveFile *saveFile=nullptr)
Definition
worldtowns.cpp:32
WorldTowns::load
void load(SaveFile *saveFile=nullptr)
Expand the visited-town flags from the save.
Definition
worldtowns.cpp:39
WorldTowns::townsSet
void townsSet(int ind, bool val)
Set/clear visited for town ind.
Definition
worldtowns.cpp:78
WorldTowns::save
void save(SaveFile *saveFile)
Flatten the visited-town flags to the save.
Definition
worldtowns.cpp:56
WorldTowns::townsCount
int townsCount()
Number of town flags (townCount).
Definition
worldtowns.cpp:68
WorldTowns::visitedTownsChanged
protected::void visitedTownsChanged()
WorldTowns::reset
void reset()
Clear all visited flags.
Definition
worldtowns.cpp:84
types.h
Project-wide fixed-width integer aliases (var8, var16, ...).
var8
var8e var8
Everyday 8-bit alias. Exact (not "fastest") to dodge the pointer-width bug noted above.
Definition
types.h:124
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
townCount
constexpr var8 townCount
Towns tracked as fly destinations.
Definition
worldtowns.h:23
townByteCount
constexpr var8 townByteCount
5 bits of 16 unused
Definition
worldtowns.h:24
projects
savefile
src
pse-savefile
expanded
world
worldtowns.h
Generated by
1.17.0