QtCraft API C++ classes QML types Handbook

QcArmourStandManager Class

Armour stands of a world (decision E-238): placed entities that wear armour and hold an item, with a pose, but no AI, no health and no physics; they stand where they were placed. More...

Header: #include <server/gameplay/QcArmourStandManager.h>

Public Functions

bool add(const QcArmourStand &stand)
qsizetype adopt(const QList<QcArmourStand> &stands)
QList<QcArmourStand> &editableStands()
QcArmourStand *find(quint32 id)
const QcArmourStand *find(quint32 id) const
bool isFull() const
qsizetype limit() const
std::optional<QcArmourStand> remove(quint32 id)
qsizetype restore(QList<QcArmourStand> stands)
void setLimit(qsizetype limit)
const QList<QcArmourStand> &stands() const
void tick(double dt)

Static Public Members

QcAabb bodyOf(const QcArmourStand &stand)
const int maxNameLength
const int maxStands
const int maxStoredStands

Detailed Description

Not creatures: they never count towards the mob limits. Pure data; QcServerStands does what players and commands do to them.

Member Function Documentation

bool QcArmourStandManager::add(const QcArmourStand &stand)

Adds stand. Returns false when the limit is reached.

qsizetype QcArmourStandManager::adopt(const QList<QcArmourStand> &stands)

Adds the stands of a chunk that came back (decision E-374); returns how many were left out at the limit.

[static] QcAabb QcArmourStandManager::bodyOf(const QcArmourStand &stand)

Returns the box of the body of stand.

QList<QcArmourStand> &QcArmourStandManager::editableStands()

Returns the stands for moving them from outside (pistons push them, decision E-337); never add or remove through it.

QcArmourStand *QcArmourStandManager::find(quint32 id)

Returns the stand with entity id, or null when there is none.

const QcArmourStand *QcArmourStandManager::find(quint32 id) const

Returns the stand with entity id, or null when there is none.

bool QcArmourStandManager::isFull() const

Returns whether the limit is reached.

qsizetype QcArmourStandManager::limit() const

Returns the number of stands the world may hold.

See also setLimit().

std::optional<QcArmourStand> QcArmourStandManager::remove(quint32 id)

Removes the stand with entity id. Returns it (to drop what it carried), or nothing when there is none.

qsizetype QcArmourStandManager::restore(QList<QcArmourStand> stands)

Replaces all stands with stands, e.g. from a save. Returns how many entries beyond the limit were left out.

void QcArmourStandManager::setLimit(qsizetype limit)

Sets the number of stands the world may hold to limit.

See also limit().

const QList<QcArmourStand> &QcArmourStandManager::stands() const

Returns every stand.

void QcArmourStandManager::tick(double dt)

Advances the hit timers by dt seconds and removes stands in the void.

Member Variable Documentation

const int QcArmourStandManager::maxNameLength

Characters of a stand's name at most.

const int QcArmourStandManager::maxStands

Stands in the world by default (QcServerLimits::maxArmourStands); a save holds at most the highest limit.

const int QcArmourStandManager::maxStoredStands

Stands a save holds at most.