Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
daycare.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
19#include <pse-common/types.h>
21
22// PlayerBasics is used as a slot parameter below; include the full type so its
23// QMetaType resolves now that it is no longer Q_DECLARE_OPAQUE_POINTER'd.
25// PokemonBox is a Q_PROPERTY below — full include so QML can traverse it.
27
28class SaveFile;
29class PokemonBox;
30class PlayerBasics;
31
41class SAVEFILE_AUTOPORT Daycare : public QObject
42{
43 Q_OBJECT
44
45 Q_PROPERTY(PokemonBox* pokemon MEMBER pokemon NOTIFY pokemonChanged)
46
47public:
48 Daycare(SaveFile* saveFile = nullptr);
49 virtual ~Daycare();
50
51 void load(SaveFile* saveFile = nullptr);
52 void save(SaveFile* saveFile);
53
54signals:
56
57public slots:
58 void reset();
59 void randomize(PlayerBasics* basics);
60
61public:
62 PokemonBox* pokemon = nullptr;
63};
void reset()
Empty the Day Care.
Definition daycare.cpp:73
Daycare(SaveFile *saveFile=nullptr)
< The Pokemon left at the Day Care (may be empty).
Definition daycare.cpp:31
protected::void pokemonChanged()
void load(SaveFile *saveFile=nullptr)
Expand the day-care mon from the save.
Definition daycare.cpp:47
void save(SaveFile *saveFile)
Flatten the day-care mon to the save.
Definition daycare.cpp:63
void randomize(PlayerBasics *basics)
Put a random mon in the Day Care.
Definition daycare.cpp:83
PokemonBox * pokemon
Definition daycare.h:62
The trainer's headline values: name, ID, money, coins, badges, starter.
A single Pokemon record – the most property-rich object in the tree.
Definition pokemonbox.h:213
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition savefile.h:46
Project-wide fixed-width integer aliases (var8, var16, ...).
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.