QtCraft API C++ classes QML types Handbook

QcArmourSerializer Namespace

The armour of an item in the content sync (QcContentSerializer): written by the server, read and checked by the client like the rest of the content. More...

Header: #include <common/content/items/QcArmourSerializer.h>

Functions

std::optional<std::optional<QcArmourDefinition>> read(QDataStream &stream)
void write(QDataStream &stream, const std::optional<QcArmourDefinition> &armour)

Detailed Description

Function Documentation

std::optional<std::optional<QcArmourDefinition>> QcArmourSerializer::read(QDataStream &stream)

Returns the armour of one item read from stream: an engaged optional holding std::nullopt for an item without armour, std::nullopt when the data is corrupt or out of the parser's limits.

void QcArmourSerializer::write(QDataStream &stream, const std::optional<QcArmourDefinition> &armour)

Writes armour to stream: a presence flag, then the definition when there is one.