QtCraft API C++ classes QML types Handbook

QcFireRules::Dice Struct

struct QcFireRules::Dice

The dice of one step of a fire: drawn from the world's seed, the fire's position and its age, not from the tick, so the same in every run, independent of the order fires take their steps in, and the same after the fire's chunk was away for a while (decision E-374). More...

Header: #include <server/blocks/QcFireRules.h>

Public Functions

quint64 nextStep(quint64 now) const
quint32 roll(QcBlockPos target, quint32 salt, quint32 bound) const

Public Variables

int age
QcBlockPos fire
quint64 seed

Detailed Description

Member Function Documentation

quint64 Dice::nextStep(quint64 now) const

Returns the tick of the fire's next step after a step at now.

quint32 Dice::roll(QcBlockPos target, quint32 salt, quint32 bound) const

Returns a number in [0, bound) for a decision (salt) about the cell target.

Member Variable Documentation

int Dice::age

The fire's age in steps.

QcBlockPos Dice::fire

The position of the fire.

quint64 Dice::seed

The world's seed.