Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
gamecornerdb.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 <QVector>
19
#include "
./db_autoport.h
"
20
21
class
GameCornerDBEntry
;
22
class
QQmlEngine;
23
34
class
DB_AUTOPORT
GameCornerDB :
public
QObject
35
{
36
Q_OBJECT
37
Q_PROPERTY(
int
getStoreSize
READ
getStoreSize
CONSTANT)
38
Q_PROPERTY(
int
getBuyPrice
READ
getBuyPrice
CONSTANT)
39
Q_PROPERTY(
int
getSellPrice
READ
getSellPrice
CONSTANT)
40
41
public
:
42
// Get Instance
43
static
GameCornerDB*
inst
();
44
45
// Get Properties, includes QML array helpers
46
const
QVector<GameCornerDBEntry*>
getStore
()
const
;
47
int
getStoreSize
()
const
;
48
49
// QML Methods that can't be a property or slot because they take an argument
50
Q_INVOKABLE
GameCornerDBEntry
*
getStoreAt
(
const
int
ind)
const
;
51
int
getBuyPrice
()
const
;
52
int
getSellPrice
()
const
;
53
54
public
slots:
55
void
load
();
56
void
deepLink
();
57
void
qmlProtect
(
const
QQmlEngine*
const
engine)
const
;
58
59
private
slots:
60
void
qmlRegister()
const
;
61
62
private
:
63
GameCornerDB();
64
65
QVector<GameCornerDBEntry*> store;
66
67
// Buy and Sell Price
68
// Pokedollars <=> Game Coins
69
// Regular Casinos give you an even exchange, you get the exact amount back
70
// But in the Poke-World I want to follow the global sell-back mechanics
71
// whereby you get half back
72
int
buyPrice = 0;
73
74
friend
class
GameCornerDBEntry
;
75
};
GameCornerDB::deepLink
void deepLink()
Resolve each prize's item/Pokemon links.
Definition
gamecornerdb.cpp:71
GameCornerDB::qmlProtect
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
Definition
gamecornerdb.cpp:85
GameCornerDB::getStoreAt
GameCornerDBEntry * getStoreAt(const int ind) const
Prize by store index (for QML).
Definition
gamecornerdb.cpp:124
GameCornerDB::getStoreSize
int getStoreSize() const
Prize count.
Definition
gamecornerdb.cpp:119
GameCornerDB::GameCornerDBEntry
friend class GameCornerDBEntry
Lets entries populate the store/price during load.
Definition
gamecornerdb.h:74
GameCornerDB::getStore
const QVector< GameCornerDBEntry * > getStore() const
All prize entries.
Definition
gamecornerdb.cpp:114
GameCornerDB::load
void load()
Load prizes from JSON.
Definition
gamecornerdb.cpp:36
GameCornerDB::getBuyPrice
int getBuyPrice() const
The buy rate (backs getBuyPrice).
Definition
gamecornerdb.cpp:132
GameCornerDB::inst
static GameCornerDB * inst()
< Number of prize entries.
Definition
gamecornerdb.cpp:108
GameCornerDB::getSellPrice
int getSellPrice() const
The sell rate (half the buy rate).
Definition
gamecornerdb.cpp:137
db_autoport.h
Import/export macro for the db library, plus the central list of DB entry pointer types declared opaq...
DB_AUTOPORT
#define DB_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.
Definition
db_autoport.h:37
GameCornerDBEntry
One Game Corner prize: a Pokemon or item, its coin price, and level.
Definition
gamecornerdbentry.h:37
projects
db
src
pse-db
gamecornerdb.h
Generated by
1.17.0