QtCraft API C++ classes QML types Handbook

QcBlockPrediction Class

Whether the session shows the blocks of the local player's breaks and placements before the server confirms them, and the numbers of the predicted actions (decision E-853). More...

Header: #include <clientcore/player/QcBlockPrediction.h>

Public Functions

bool isOn() const
quint32 next(const QList<QcMsg::BlockUpdate> &blocks)
quint32 sequence() const
void setOn(bool on)

Static Public Members

bool wanted()

Detailed Description

Part of QcClientSession: it numbers each predicted action; the session shows the blocks in the world mirror and in the tick core. Numbers start anew with every session (a reconnect too).

Member Function Documentation

bool QcBlockPrediction::isOn() const

Returns whether the blocks are predicted.

quint32 QcBlockPrediction::next(const QList<QcMsg::BlockUpdate> &blocks)

Returns the number of a new action that sets blocks, or 0 when the prediction is off or blocks is empty (nothing to show).

quint32 QcBlockPrediction::sequence() const

Returns the number of the latest predicted action, 0 before the first.

void QcBlockPrediction::setOn(bool on)

Turns the prediction on or off with on; applies from the next action on.

See also isOn().

[static] bool QcBlockPrediction::wanted()

Returns whether a new session predicts blocks: on unless QTCRAFT_BLOCK_PREDICTION=0.