QtCraft API C++ classes QML types Handbook

QcMobSerializer Namespace

Wire format of one creature definition in the content sync: what the client shows and uses of it (size, model parts, sounds, glow, breeding food, tameable, milking, the thread of a family). More...

Header: #include <common/content/mobs/QcMobSerializer.h>

Functions

std::optional<QcMobDefinition> readMob(QDataStream &stream)
void writeMob(QDataStream &stream, const QcMobDefinition &mob)

Detailed Description

Reading validates everything that later feeds physics and the mesher.

Function Documentation

std::optional<QcMobDefinition> QcMobSerializer::readMob(QDataStream &stream)

Returns the creature read from stream; std::nullopt (and possibly a corrupt stream) on bad data.

void QcMobSerializer::writeMob(QDataStream &stream, const QcMobDefinition &mob)

Writes the parts of mob that the client uses to stream.