QtCraft API C++ classes QML types Handbook

QcEnchantmentSerializer Namespace

The enchantments in the content sync (QcContentSerializer, decision E-864): every field, so the client knows effects and names. More...

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

Functions

QcStatus read(QDataStream &stream, QcContentRegistry &registry)
void write(QDataStream &stream, const QList<QcEnchantmentDefinition> &enchantments)

Detailed Description

Reading checks every value like the parser.

Function Documentation

QcStatus QcEnchantmentSerializer::read(QDataStream &stream, QcContentRegistry &registry)

Reads the enchantments written by write() from stream and registers each in registry; returns an error at the first corrupt or implausible one.

void QcEnchantmentSerializer::write(QDataStream &stream, const QList<QcEnchantmentDefinition> &enchantments)

Writes the count of enchantments and then each of them to stream.