|
Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
|
Market row for an item the player can buy from the store. More...
#include <itemmarketentrystoreitem.h>
Public Member Functions | |
| ItemMarketEntryStoreItem (ItemDBEntry *data, ItemStorageBox *toBag, ItemStorageBox *toBox) | |
| virtual | ~ItemMarketEntryStoreItem () |
| StackReturn | calculateStacks () |
| Work out the full/partial bag-and-box landing for the cart qty. | |
| virtual QString | _name () override |
| Subtype: compute the display name. | |
| virtual int | _inStockCount () override |
| Subtype: compute the owned/sellable count. | |
| virtual bool | _canSell () override |
| Subtype: compute sellability. | |
| virtual int | _itemWorth () override |
| Subtype: compute the unit value. | |
| virtual QString | _whichType () override |
| Subtype: report the type label. | |
| virtual int | onCartLeft () override |
| Subtype: how many more may be added. | |
| virtual int | stackCount () override |
| Subtype: new stack slots needed (see note above). | |
| virtual QString | infoText () override |
| Detailed-tooltip body (default none). | |
| virtual void | checkout () override |
| Buy the item (into bag/box). | |
| Public Member Functions inherited from ItemMarketEntry | |
| ItemMarketEntry (int compatMoneyCurrency=CompatEither, int compatBuyMode=CompatEither) | |
| virtual | ~ItemMarketEntry () |
| virtual void | initOnce () |
| One-time setup for the first instance of a type. | |
| void | finishConstruction () |
| Finalise construction (register the instance). | |
| QString | name () |
| Cached display name. | |
| int | inStockCount () |
| Cached owned/sellable count. | |
| bool | canSell () |
| Cached sellable flag. | |
| int | itemWorth () |
| Cached unit value. | |
| QString | whichType () |
| Cached type label. | |
| bool | requestFilter () |
| Helper: does this row pass the current mode filter? | |
| int | getCartCount () |
Current cart quantity (backs onCart). | |
| int | cartWorth () |
| Value of the cart quantity. | |
| int | totalStackCount () |
| Stacks across all rows of this type. | |
| int | totalWorth () |
| Signed worth across ALL rows (sell +, buy -). | |
| int | moneyLeftover () |
| Money remaining if this checks out. | |
| virtual bool | canCheckout () |
| Can this row alone check out? | |
| bool | canAnyCheckout () |
| Can any row check out? | |
| void | setCartCount (int val) |
Set the cart quantity (backs onCart). | |
| void | reUpdateConstants () |
| Clear the cached mode-stable values. | |
Public Attributes | |
| ItemDBEntry * | data = nullptr |
| The item being sold. | |
| ItemStorageBox * | toBag = nullptr |
| Destination bag. | |
| ItemStorageBox * | toBox = nullptr |
| Overflow PC item box. | |
| Public Attributes inherited from ItemMarketEntry | |
| int | compatMoneyCurrency = CompatEither |
| Money/coins compatibility. | |
| int | compatBuyMode = CompatEither |
| Buy/sell compatibility. | |
| int | onCart = 0 |
| Backing cart quantity. | |
| bool | exclude = false |
| Exclude from aggregate totals (see note). | |
| int | viewTag = -1 |
| Left-list view filter tag. | |
| int | cartSignVal = 1 |
| Net contribution sign (-1 buy / +1 sell). | |
| QHash< int, QVariant > | cache |
| Memoised mode-stable values (see HashKey* enum). | |
Static Public Attributes | |
| static constexpr const char * | type = "storeItem" |
| This row's type key. | |
| Static Public Attributes inherited from ItemMarketEntry | |
| static bool * | isMoneyCurrency = nullptr |
| Shared: current currency mode. | |
| static bool * | isBuyMode = nullptr |
| Shared: current buy/sell mode. | |
| static PlayerBasics * | player = nullptr |
| Shared: player money/coins. | |
| static QHash< QString, QVector< ItemMarketEntry * > * > | instances |
| All rows, grouped by type. | |
| static QVector< ItemMarketEntry * > | instancesCombined |
| All rows, flat. | |
| static QVector< ItemMarketEntry * > * | activeList = nullptr |
| Current model's live rows. | |
Additional Inherited Members | |
| Public Types inherited from ItemMarketEntry | |
| enum | { CompatNo = 0 , CompatYes , CompatEither } |
| Three-state compatibility for the mode filters. More... | |
| enum | { HashKeyName , HashKeyInStockCount , HashKeyCanSell , HashKeyItemWorth , HashKeyWhichType } |
| Cache keys for the memoised mode-stable values. More... | |
| Protected Member Functions inherited from ItemMarketEntry | |
| void | doReUpdateConstants () |
| Force a refresh of the "mode-stable" values. | |
| Protected Attributes inherited from ItemMarketEntry | |
| : void onCartChanged() | |
| < Quantity on the cart. | |
Market row for an item the player can buy from the store.
An ItemMarketEntry subtype representing a purchasable item (data) that lands in the bag (toBag) or, if full, the PC box (toBox). calculateStacks() works out the bag/box distribution; checkout() performs the purchase. See ItemMarketEntry.
Definition at line 42 of file itemmarketentrystoreitem.h.
| ItemMarketEntryStoreItem::ItemMarketEntryStoreItem | ( | ItemDBEntry * | data, |
| ItemStorageBox * | toBag, | ||
| ItemStorageBox * | toBox ) |
Definition at line 31 of file itemmarketentrystoreitem.cpp.
References ItemMarketEntry::cartSignVal, ItemMarketEntry::CompatEither, data, ItemMarketEntry::finishConstruction(), ItemMarketEntry::ItemMarketEntry(), toBag, and toBox.
|
virtual |
Definition at line 46 of file itemmarketentrystoreitem.cpp.
|
overridevirtual |
Subtype: compute sellability.
Implements ItemMarketEntry.
Definition at line 173 of file itemmarketentrystoreitem.cpp.
|
overridevirtual |
Subtype: compute the owned/sellable count.
Implements ItemMarketEntry.
Definition at line 167 of file itemmarketentrystoreitem.cpp.
|
overridevirtual |
Subtype: compute the unit value.
Implements ItemMarketEntry.
Definition at line 179 of file itemmarketentrystoreitem.cpp.
References data, ItemMarketEntry::isMoneyCurrency, and ItemMarketEntry::requestFilter().
|
overridevirtual |
Subtype: compute the display name.
Implements ItemMarketEntry.
Definition at line 159 of file itemmarketentrystoreitem.cpp.
References data, and ItemMarketEntry::requestFilter().
|
overridevirtual |
Subtype: report the type label.
Implements ItemMarketEntry.
Definition at line 192 of file itemmarketentrystoreitem.cpp.
References type.
| StackReturn ItemMarketEntryStoreItem::calculateStacks | ( | ) |
Work out the full/partial bag-and-box landing for the cart qty.
Definition at line 53 of file itemmarketentrystoreitem.cpp.
References Item::amount, data, StackReturn::full, ItemMarketEntry::onCart, StackReturn::partialBag, StackReturn::partialBox, StackReturn::partialElBag, StackReturn::partialElBox, ItemMarketEntry::requestFilter(), toBag, and toBox.
Referenced by checkout(), onCartLeft(), and stackCount().
|
overridevirtual |
Buy the item (into bag/box).
Implements ItemMarketEntry.
Definition at line 266 of file itemmarketentrystoreitem.cpp.
References calculateStacks(), ItemMarketEntry::canCheckout(), ItemMarketEntry::cartWorth(), data, ItemMarketEntry::isMoneyCurrency, ItemMarketEntry::onCart, ItemMarketEntry::player, ItemMarketEntry::requestFilter(), toBag, and toBox.
|
overridevirtual |
Detailed-tooltip body (default none).
Reimplemented from ItemMarketEntry.
Definition at line 48 of file itemmarketentrystoreitem.cpp.
References data.
|
overridevirtual |
Subtype: how many more may be added.
Implements ItemMarketEntry.
Definition at line 200 of file itemmarketentrystoreitem.cpp.
References calculateStacks(), ItemMarketEntry::itemWorth(), ItemMarketEntry::moneyLeftover(), ItemMarketEntry::requestFilter(), toBag, toBox, and ItemMarketEntry::totalStackCount().
|
overridevirtual |
Subtype: new stack slots needed (see note above).
Implements ItemMarketEntry.
Definition at line 258 of file itemmarketentrystoreitem.cpp.
References calculateStacks(), StackReturn::full, and ItemMarketEntry::requestFilter().
| ItemDBEntry* ItemMarketEntryStoreItem::data = nullptr |
The item being sold.
Definition at line 66 of file itemmarketentrystoreitem.h.
Referenced by _itemWorth(), _name(), calculateStacks(), checkout(), infoText(), and ItemMarketEntryStoreItem().
| ItemStorageBox* ItemMarketEntryStoreItem::toBag = nullptr |
Destination bag.
Definition at line 67 of file itemmarketentrystoreitem.h.
Referenced by calculateStacks(), checkout(), ItemMarketEntryStoreItem(), and onCartLeft().
| ItemStorageBox* ItemMarketEntryStoreItem::toBox = nullptr |
Overflow PC item box.
Definition at line 68 of file itemmarketentrystoreitem.h.
Referenced by calculateStacks(), checkout(), ItemMarketEntryStoreItem(), and onCartLeft().
|
staticconstexpr |
This row's type key.
Definition at line 65 of file itemmarketentrystoreitem.h.
Referenced by _whichType().