QcEntityRecords Namespace
Turns the entities of a running world into the records saved per chunk and back (decisions E-366, E-374). More...
| Header: | #include <server/storage/QcEntityRecords.h> |
Functions
| QStringList | apply(const QcEntityRecord &record, QcEntities &entities) |
| QHash<QcChunkPos, QcEntityRecord> | collect(const QcEntities &entities) |
| QHash<QcChunkPos, QcEntityRecord> | take(QcEntities &entities, const QSet<QcChunkPos> &chunks) |
Detailed Description
Function Documentation
QStringList QcEntityRecords::apply(const QcEntityRecord &record, QcEntities &entities)
Puts the entities of the chunk record into the world entities, each kind in its saved order after those already there, with new ids given to items, falling blocks, creatures and stands in that order. The limits of the kinds apply as when they are made (items beyond the total limit wait, falling blocks and stands beyond theirs are left out); returns the warnings about what was left out.
QHash<QcChunkPos, QcEntityRecord> QcEntityRecords::collect(const QcEntities &entities)
Returns a record for every chunk of entities with entities to keep (persistent creatures, items and waiting drops, falling blocks, stands), each entry with its place in its kind's table (items first, then the drops waiting to appear). populated is left to the caller.
QHash<QcChunkPos, QcEntityRecord> QcEntityRecords::take(QcEntities &entities, const QSet<QcChunkPos> &chunks)
Returns the same for the chunks in chunks, and the entities are taken out of the world: the records of chunks that leave it (from entities). Creatures that are not persistent and sliding blocks go without a record.