QtCraft API C++ classes QML types Handbook

QcWeatherState Struct

The weather of a world as world.json keeps it (decision E-395): the current spell (kind and the ticks until it ends), how many spells the world has had, the strengths of rain and thunder, which fade towards the spell's kind, and how many ticks the weather has run. More...

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

Public Variables

QcWeatherKind kind
float rain
qint64 spell
float thunder
qint64 ticks
qint64 ticksLeft
enum class QcPrecipitation { None, Rain, Snow }
enum class QcWeatherKind { Clear, Rain, Thunder }

Detailed Description

Member Variable Documentation

QcWeatherKind QcWeatherState::kind

The kind of the current spell.

qint64 QcWeatherState::spell

Spells so far; with the seed it decides the next spell. 0: the world's first spell has not begun (a new world, or one saved without weather), the first tick starts a clear one.

qint64 QcWeatherState::ticks

Ticks the weather has run (world.json "ticks", 0 when missing). With the seed it decides the random draws of each tick (strikes, snowfall; QcWeatherCycle::Draws), so they go on after loading as if the world had not been saved (decision E-397).

qint64 QcWeatherState::ticksLeft

Ticks until the spell ends while the game rule weatherCycle is on.

Related Non-Members

enum class QcPrecipitation

What falls at one place while it rains: nothing (a dry biome, or no rain at all), rain or snow.

ConstantValueDescription
QcWeatherState::QcPrecipitation::None0Nothing falls.
QcWeatherState::QcPrecipitation::Rain1Rain falls.
QcWeatherState::QcPrecipitation::Snow2Snow falls.

enum class QcWeatherKind

What the sky does in the whole world (decision E-395): clear, rain (snow where it is cold) or a thunderstorm, which rains as well.

ConstantValueDescription
QcWeatherState::QcWeatherKind::Clear0Clear sky.
QcWeatherState::QcWeatherKind::Rain1Rain.
QcWeatherState::QcWeatherKind::Thunder2A thunderstorm.