QtCraft API C++ classes QML types Handbook

QcClientEnchanting Class

The enchanting table's screen the server opened for the local player (decision E-864): its item and lapis slots, the bookshelves that count and the three offers as the server last sent them (state()), and the offer the player takes. More...

Header: #include <clientcore/session/QcClientEnchanting.h>

Public Functions

bool choose(int slot)
QList<QcItemStack> slotStacks() const

Protected Functions

bool sameState(const QcMsg::EnchantingState &a, const QcMsg::EnchantingState &b) const

Detailed Description

Items go in and out through the inventory's slot messages (item and lapis are the machine's input and fuel slots while the screen is open). Part of QcClientSession; GUI-free.

Member Function Documentation

bool QcClientEnchanting::choose(int slot)

Asks the server for offer slot (0–2). Returns false when no screen is open or the slot is invalid.

[protected] bool QcClientEnchanting::sameState(const QcMsg::EnchantingState &a, const QcMsg::EnchantingState &b) const

Returns whether a and b have the same slots, shelves and offers (the rune seed changes only along with them).

QList<QcItemStack> QcClientEnchanting::slotStacks() const

Returns the item and lapis slots and an unused output slot, laid out like a machine's slots for the inventory model.