QcCreatureComponents Namespace
The components of a creature entry in the entities of a chunk (QcEntityCodec, decision E-420): health and breeding (Creature), the villager record, status effects, the carried block, the enclosure, the golem's builder, the laying timer, the tame state, a creature without a mind and the parent of a child of a kept family (decision E-839). More...
| Header: | #include <server/storage/QcCreatureComponents.h> |
Classes
| struct | Read |
Functions
| std::optional<QcCreatureComponents::Read> | read(QDataStream &stream, QcMobManager::Stored mob) |
| QcComponentFrames::Writer & | write(QcComponentFrames::Writer &components, const QcMobManager::Stored &mob, const QcContentRegistry &content) |
Detailed Description
Classes
class Read
A creature read from its components, the carried block still by name (the caller resolves it against the content and reports one it no longer has), and the components this version does not know. More...
Function Documentation
std::optional<QcCreatureComponents::Read> QcCreatureComponents::read(QDataStream &stream, QcMobManager::Stored mob)
Reads the components of a creature entry from stream onto mob (filled from the entry's header, health at the type's full health) and returns them; std::nullopt for damaged data.
QcComponentFrames::Writer &QcCreatureComponents::write(QcComponentFrames::Writer &components, const QcMobManager::Stored &mob, const QcContentRegistry &content)
Adds the known components of mob, carried blocks by their name in content, to components, the writer of its entry, and returns that writer (the generic writer of QcComponentFrames, extended from outside: rank 3 of the rule on output parameters).