QtCraft API C++ classes QML types Handbook

QcEntityRecord Struct

What is saved of the entities of one chunk (decision E-366): the chunk holding each one's feet. More...

Header: #include <server/storage/QcEntityRecord.h>

Public Types

struct Ordered

Public Functions

bool isEmpty() const

Public Variables

QList<QcEntityRecord::Ordered<QcBoat>> boats
QcChunkPos chunk
QList<QcEntityRecord::Ordered<QcMobManager::Stored>> creatures
QList<QcEntityRecord::Ordered<QcFallingBlock>> fallingBlocks
QList<QcEntityRecord::Ordered<QcHangingEntity>> hangings
QList<QcEntityRecord::Ordered<QcItemEntityManager::Drop>> items
QList<QcEntityRecord::Ordered<QcMinecart>> minecarts
QList<QcEntityRecord::Ordered<QcExperienceOrb>> orbs
bool populated
QList<QcEntityRecord::Ordered<QcPrimedExplosive>> primedExplosives
QList<QcEntityRecord::Ordered<QcProjectile>> projectiles
QList<QcEntityRecord::Ordered<QcArmourStand>> stands

Static Public Members

const quint64 waitingOrderBase

Detailed Description

Every entry carries a key of its place in the table of its kind (order): its entity id (tables only append and keep their order when they remove, so id order is table order), for drops waiting to appear waitingOrderBase plus their place in the queue. The key does not change while an entity lives, so a record changes only when its own chunk's entities do; sorted by it, the tables come back in the same order and the world goes on exactly as it was saved.

Member Function Documentation

bool QcEntityRecord::isEmpty() const

Returns whether the record has no entities; a populated chunk still keeps its record.

Member Variable Documentation

QList<QcEntityRecord::Ordered<QcBoat>> QcEntityRecord::boats

Boats with their motion and item; the id and the riders are not saved (decision E-920).

QcChunkPos QcEntityRecord::chunk

The chunk.

QList<QcEntityRecord::Ordered<QcMobManager::Stored>> QcEntityRecord::creatures

Persistent creatures; the others are not saved and appear again around the players.

QList<QcEntityRecord::Ordered<QcFallingBlock>> QcEntityRecord::fallingBlocks

Falling blocks with their motion; the id is not saved.

QList<QcEntityRecord::Ordered<QcHangingEntity>> QcEntityRecord::hangings

Item frames and paintings; the id is not saved (decision E-793).

QList<QcEntityRecord::Ordered<QcItemEntityManager::Drop>> QcEntityRecord::items

Items lying in the chunk and drops waiting to appear there.

QList<QcEntityRecord::Ordered<QcMinecart>> QcEntityRecord::minecarts

Minecarts with their motion; the id and the rider are not saved.

QList<QcEntityRecord::Ordered<QcExperienceOrb>> QcEntityRecord::orbs

Experience orbs with their motion, value and age; the id is not saved (decision E-398).

bool QcEntityRecord::populated

The chunk got its group of animals already (decision E-086); kept with the chunk.

QList<QcEntityRecord::Ordered<QcPrimedExplosive>> QcEntityRecord::primedExplosives

Lit explosives with their motion and fuse, saved as falling blocks with a fuse (decision E-601); the id is not saved.

QList<QcEntityRecord::Ordered<QcProjectile>> QcEntityRecord::projectiles

Projectiles flying or stuck, by their type's name; the id and the shooter are not saved (decision E-425).

QList<QcEntityRecord::Ordered<QcArmourStand>> QcEntityRecord::stands

Armour stands; the id is not saved.

const quint64 QcEntityRecord::waitingOrderBase

Waiting drops come after every item that already lies in the world.