QtCraft API C++ classes QML types Handbook

QcVillagePiece Struct

One kind of building of a style (decision E-403): one of its blueprints, chosen by weight, per building. More...

Header: #include <common/content/villages/QcVillageDefinitions.h>

Public Functions

bool hasRules() const

Public Variables

QList<QcWeightedStructureName> blueprints
double chance
QcVillageJetty jetty
int max
int minRoadLength
int water
int weight

Static Public Members

const int maxBlueprints

Detailed Description

The rules (decision E-404, E-408) make a kind conditional: built only with chance per village, only in villages whose roads are at least minRoadLength blocks long together, only at a road end with water at most water blocks ahead. Kinds with rules are placed before the others, at most max (at least 1).

Member Function Documentation

bool QcVillagePiece::hasRules() const

Returns whether it has any rule (chance below 1, a least road length or a water rule).

Member Variable Documentation

QList<QcWeightedStructureName> QcVillagePiece::blueprints

Its blueprints: "structure" (one) or "structures" (1 to maxBlueprints, each with a weight), structures (structures/*.json) whose door side, the south side of their first layer, faces the road they stand on.

double QcVillagePiece::chance

Chance per village that it is built at all ("chance").

QcVillageJetty QcVillagePiece::jetty

The walkway out to the water of a kind with a water rule ("jetty").

int QcVillagePiece::max

At most this many in one village; 0: no limit.

const int QcVillagePiece::maxBlueprints

Most blueprints of a kind.

int QcVillagePiece::minRoadLength

Least length in blocks of all the village's roads together ("minRoadLength").

int QcVillagePiece::water

Blocks ahead of a road end within which water must lie ("water", 0..32); 0: no water rule.

int QcVillagePiece::weight

Relative chance against the other kinds of the style.