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