QtCraft API C++ classes QML types Handbook

QcGeneratorVersion Namespace

The versions of the world generator (decision E-922). More...

Header: #include <common/world/QcGeneratorVersion.h>

Variables

const int current
const int lastFrozen
const int maxStored
const int oldest
const int unversioned

Functions

bool isKnown(int version)

Detailed Description

A world keeps the version it was created with in world.json ("generator"/"version") and is generated with it for good, so that chunks made after an update fit those made before. A version promises the output of the base game's generator code together with the base game's worldgen data at that version (terrain, flat and void worlds; the showcase is a demonstration world that always generates with the current code); what mods add on top is the player's choice. tests/terrain/test_generator_versions checks every version against recorded checksums of generated chunks; a change of the generator's output needs a new version (checklist in docs/Entscheidungen.md, E-922).

Variable Documentation

const int QcGeneratorVersion::current

The newest version this game generates: the version of new worlds.

const int QcGeneratorVersion::lastFrozen

The newest frozen version, 0 for none: a version freezes when a release build ships it, and its output is kept for good from then on. A newer one is open: it may still change (its checksums are recorded anew) until a release ships it (decision E-922). Set to current with each release; release 0.1.0 froze version 1, release 1.0.0 version 2.

const int QcGeneratorVersion::maxStored

Highest number world.json may name (a newer game's version) before it counts as damaged.

const int QcGeneratorVersion::oldest

The oldest version this game still generates.

const int QcGeneratorVersion::unversioned

The version of worlds saved without one (before decision E-922).

Function Documentation

[constexpr] bool QcGeneratorVersion::isKnown(int version)

Returns whether this game generates version (oldest to current).