19#include <QAbstractListModel>
69 void isBuyModeChanged();
70 void isMoneyCurrencyChanged();
71 void isExchangeModeChanged();
73 void reUpdateValues();
167 virtual int rowCount(
const QModelIndex& parent)
const override;
168 virtual QVariant
data(
const QModelIndex& index,
int role)
const override;
169 virtual QHash<int, QByteArray>
roleNames()
const override;
170 bool setData(
const QModelIndex& index,
const QVariant& value,
int role)
override;
Abstract base for one row of the item market – the row-type hierarchy root.
Storage * storage
PC storage (for received Pokemon).
void buildExchangeList()
Build the money<->coins exchange rows (both directions).
ItemRoles
Columns (mapped in roleNames()); comments describe each.
bool setData(const QModelIndex &index, const QVariant &value, int role) override
Edit a row (cart count).
ItemStorageBox * itemStorage
The PC item box.
bool buyableInGame(ItemDBEntry *el) const
Is el sold by a reachable Gen-1 vendor (Normal vs Special)?
virtual QHash< int, QByteArray > roleNames() const override
Role -> QML name.
PlayerBasics * basics
Player money/coins.
void exchangeAdjust(int deltaCoins)
Nudge the net (+Coins = +1, +Money = -1).
void clearList()
Empty the row cache.
bool vendorListItem(ItemDBEntry *el)
Should el appear in the store list (has a price here)?
virtual int rowCount(const QModelIndex &parent) const override
Row count.
bool isVendingItem(ItemDBEntry *el) const
Is el a Celadon vending-machine drink (its own group)?
void checkout()
Apply the cart transaction to the save.
virtual QVariant data(const QModelIndex &index, int role) const override
Row+role value.
ItemStorageBox * itemBag
The player's bag.
void buildPlayerItemList()
Build rows from the player's items.
ItemMarketModel(ItemStorageBox *itemBag, ItemStorageBox *itemStorage, PlayerBasics *basics, Router *router, PlayerPokemon *playerPokemon, Storage *storage, SaveFile *file)
void buildList()
Build the rows for the current mode.
void pageOpening(QString path)
Hook when the market page opens.
void reUpdateAll()
Rebuild + recompute everything.
Router * router
For page hooks.
void onReUpdateValues()
Recompute the derived totals.
QVector< ItemMarketEntry * > itemListCache
The current market rows.
void buildMartItemList()
Build rows from the store stock.
PlayerPokemon * playerPokemon
Party (for received Pokemon).
int exchangeNet()
+N buying N coins / -N selling N coins.
SaveFile * file
The live save.
A container of Items – either the trainer's bag or a PC item box.
The trainer's headline values: name, ID, money, coins, badges, starter.
The player's active party – a specialized PokemonStorageBox.
Screen navigation for the UI – the QML StackView's controller.
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
The PC: the item storage box and all 12 Pokemon boxes.
One item's static data: name/flags, pricing, and where it's used.