Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
worldtrades.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
tradeCount
= 10;
24
constexpr
var8
tradeByteCount
= 2;
25
35
class
SAVEFILE_AUTOPORT
WorldTrades
:
public
QObject
36
{
37
Q_OBJECT
38
39
public
:
40
WorldTrades
(
SaveFile
* saveFile =
nullptr
);
41
virtual
~WorldTrades
();
42
43
void
load
(
SaveFile
* saveFile =
nullptr
);
44
void
save
(
SaveFile
* saveFile);
45
46
Q_INVOKABLE
int
tradesCount
();
47
Q_INVOKABLE
bool
tradesAt
(
int
ind);
48
Q_INVOKABLE
void
tradesSet
(
int
ind,
bool
val);
49
50
signals:
51
void
completedTradesChanged
();
52
53
public
slots:
54
void
reset
();
55
void
randomize
();
56
57
public
:
58
bool
completedTrades
[
tradeCount
];
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
WorldTrades::save
void save(SaveFile *saveFile)
Flatten the trade flags to the save.
Definition
worldtrades.cpp:54
WorldTrades::completedTradesChanged
protected::void completedTradesChanged()
WorldTrades::WorldTrades
WorldTrades(SaveFile *saveFile=nullptr)
Definition
worldtrades.cpp:30
WorldTrades::randomize
void randomize()
Randomize the trade flags.
Definition
worldtrades.cpp:89
WorldTrades::tradesSet
void tradesSet(int ind, bool val)
Set/clear completed for trade ind.
Definition
worldtrades.cpp:76
WorldTrades::load
void load(SaveFile *saveFile=nullptr)
Expand the trade flags from the save.
Definition
worldtrades.cpp:37
WorldTrades::completedTrades
bool completedTrades[tradeCount]
Per-trade completed flags.
Definition
worldtrades.h:58
WorldTrades::tradesCount
int tradesCount()
Number of trade flags (tradeCount).
Definition
worldtrades.cpp:66
WorldTrades::tradesAt
bool tradesAt(int ind)
Is trade ind completed?
Definition
worldtrades.cpp:71
WorldTrades::reset
void reset()
Clear all trade flags.
Definition
worldtrades.cpp:82
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
tradeCount
constexpr var8 tradeCount
In-game NPC trades tracked.
Definition
worldtrades.h:23
tradeByteCount
constexpr var8 tradeByteCount
6 of 16 bits unused
Definition
worldtrades.h:24
projects
savefile
src
pse-savefile
expanded
world
worldtrades.h
Generated by
1.17.0