Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
itemmarketentrystoreitem.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 "
./itemmarketentry.h
"
18
19
class
Item
;
20
class
ItemDBEntry
;
21
class
ItemStorageBox
;
22
24
struct
StackReturn
{
25
int
full
= 0;
26
27
int
partialBag
= 0;
28
int
partialBox
= 0;
29
30
Item
*
partialElBag
=
nullptr
;
31
Item
*
partialElBox
=
nullptr
;
32
};
33
42
class
ItemMarketEntryStoreItem
:
public
ItemMarketEntry
43
{
44
Q_OBJECT
45
46
public
:
47
ItemMarketEntryStoreItem
(
ItemDBEntry
*
data
,
ItemStorageBox
*
toBag
,
ItemStorageBox
*
toBox
);
48
virtual
~ItemMarketEntryStoreItem
();
49
50
StackReturn
calculateStacks
();
51
52
virtual
QString
_name
()
override
;
53
virtual
int
_inStockCount
()
override
;
54
virtual
bool
_canSell
()
override
;
55
virtual
int
_itemWorth
()
override
;
56
virtual
QString
_whichType
()
override
;
57
virtual
int
onCartLeft
()
override
;
58
virtual
int
stackCount
()
override
;
59
virtual
QString
infoText
()
override
;
60
61
public
slots:
62
virtual
void
checkout
()
override
;
63
64
public
:
65
static
constexpr
const
char
*
type
=
"storeItem"
;
66
ItemDBEntry
*
data
=
nullptr
;
67
ItemStorageBox
*
toBag
=
nullptr
;
68
ItemStorageBox
*
toBox
=
nullptr
;
69
};
ItemMarketEntryStoreItem::checkout
virtual void checkout() override
Buy the item (into bag/box).
Definition
itemmarketentrystoreitem.cpp:266
ItemMarketEntryStoreItem::_whichType
virtual QString _whichType() override
Subtype: report the type label.
Definition
itemmarketentrystoreitem.cpp:192
ItemMarketEntryStoreItem::toBox
ItemStorageBox * toBox
Overflow PC item box.
Definition
itemmarketentrystoreitem.h:68
ItemMarketEntryStoreItem::type
static constexpr const char * type
This row's type key.
Definition
itemmarketentrystoreitem.h:65
ItemMarketEntryStoreItem::_canSell
virtual bool _canSell() override
Subtype: compute sellability.
Definition
itemmarketentrystoreitem.cpp:173
ItemMarketEntryStoreItem::~ItemMarketEntryStoreItem
virtual ~ItemMarketEntryStoreItem()
Definition
itemmarketentrystoreitem.cpp:46
ItemMarketEntryStoreItem::_itemWorth
virtual int _itemWorth() override
Subtype: compute the unit value.
Definition
itemmarketentrystoreitem.cpp:179
ItemMarketEntryStoreItem::ItemMarketEntryStoreItem
ItemMarketEntryStoreItem(ItemDBEntry *data, ItemStorageBox *toBag, ItemStorageBox *toBox)
Definition
itemmarketentrystoreitem.cpp:31
ItemMarketEntryStoreItem::calculateStacks
StackReturn calculateStacks()
Work out the full/partial bag-and-box landing for the cart qty.
Definition
itemmarketentrystoreitem.cpp:53
ItemMarketEntryStoreItem::data
ItemDBEntry * data
The item being sold.
Definition
itemmarketentrystoreitem.h:66
ItemMarketEntryStoreItem::_inStockCount
virtual int _inStockCount() override
Subtype: compute the owned/sellable count.
Definition
itemmarketentrystoreitem.cpp:167
ItemMarketEntryStoreItem::toBag
ItemStorageBox * toBag
Destination bag.
Definition
itemmarketentrystoreitem.h:67
ItemMarketEntryStoreItem::stackCount
virtual int stackCount() override
Subtype: new stack slots needed (see note above).
Definition
itemmarketentrystoreitem.cpp:258
ItemMarketEntryStoreItem::infoText
virtual QString infoText() override
Detailed-tooltip body (default none).
Definition
itemmarketentrystoreitem.cpp:48
ItemMarketEntryStoreItem::_name
virtual QString _name() override
Subtype: compute the display name.
Definition
itemmarketentrystoreitem.cpp:159
ItemMarketEntryStoreItem::onCartLeft
virtual int onCartLeft() override
Subtype: how many more may be added.
Definition
itemmarketentrystoreitem.cpp:200
ItemMarketEntry::ItemMarketEntry
ItemMarketEntry(int compatMoneyCurrency=CompatEither, int compatBuyMode=CompatEither)
Definition
itemmarketentry.cpp:28
ItemStorageBox
A container of Items – either the trainer's bag or a PC item box.
Definition
itemstoragebox.h:36
Item
One inventory slot: an item index and an amount, with live pricing.
Definition
item.h:36
itemmarketentry.h
ItemDBEntry
One item's static data: name/flags, pricing, and where it's used.
Definition
itemdbentry.h:46
StackReturn
Result of working out where a bought stack lands (full stacks + partial in bag/box).
Definition
itemmarketentrystoreitem.h:24
StackReturn::partialElBox
Item * partialElBox
The PC-box item a partial merges into.
Definition
itemmarketentrystoreitem.h:31
StackReturn::partialBox
int partialBox
Remainder added to an existing PC-box stack.
Definition
itemmarketentrystoreitem.h:28
StackReturn::partialBag
int partialBag
Remainder added to an existing bag stack.
Definition
itemmarketentrystoreitem.h:27
StackReturn::full
int full
Number of full new stacks.
Definition
itemmarketentrystoreitem.h:25
StackReturn::partialElBag
Item * partialElBag
The bag item a partial merges into.
Definition
itemmarketentrystoreitem.h:30
projects
app
src
mvc
itemmarket
itemmarketentrystoreitem.h
Generated by
1.17.0