QtCraft API C++ classes QML types Handbook

QcClientStonecutter Class

The stonecutter screen the server opened for the local player (decision E-785): its input slot and the stonecutting recipe chosen for it (decision E-784) as the server last sent them, and the choices the player makes. More...

Header: #include <clientcore/session/QcClientStonecutter.h>
Inherits: QObject

Public Types

Sender

Public Functions

void close()
bool handle(const QcMessage &message)
QcItemStack input() const
bool isOpen() const
QcBlockPos pos() const
const QString &recipe() const
bool select(const QString &recipe)
void setSender(QcClientStonecutter::Sender sender)
QList<QcItemStack> slotStacks(const QcContentRegistry &content) const

Signals

void changed()
void closed()
void opened()

Detailed Description

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

Member Type Documentation

[alias] QcClientStonecutter::Sender

Sends a message to the server.

Member Function Documentation

[signal] void QcClientStonecutter::changed()

The input or the chosen recipe changed.

void QcClientStonecutter::close()

The player closed the screen; the server gives the input back.

[signal] void QcClientStonecutter::closed()

The screen closed (by the server or by close()).

bool QcClientStonecutter::handle(const QcMessage &message)

Takes over message when it is OpenStonecutter, StonecutterState or CloseStonecutter. Returns false for other messages.

QcItemStack QcClientStonecutter::input() const

Returns the stack in the input slot as the server last sent it.

bool QcClientStonecutter::isOpen() const

Returns whether the screen is open.

[signal] void QcClientStonecutter::opened()

The server opened the screen.

QcBlockPos QcClientStonecutter::pos() const

Returns where the stonecutter is.

const QString &QcClientStonecutter::recipe() const

Returns the chosen recipe's name; empty for none.

bool QcClientStonecutter::select(const QString &recipe)

Asks the server to choose the recipe recipe (empty: none). Returns false when no screen is open.

void QcClientStonecutter::setSender(QcClientStonecutter::Sender sender)

Sets the way out to the server to sender (the session's connection).

QList<QcItemStack> QcClientStonecutter::slotStacks(const QcContentRegistry &content) const

Returns the input, an unused middle slot and the output, with content, laid out like a machine's slots for the inventory model (the output follows from input and recipe, QcStonecutting::output).