QtCraft API C++ classes QML types Handbook

QcVillageSettings Struct

The village settings (worldgen/villages.json, decision E-403): how often and where villages are built, which creature kind lives in them and which golems guard them. More...

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

Public Variables

int attempts
QString bell
double chance
QcVillageGolemSettings golem
int lampSpacing
int maxHeightSpread
int maxPieceSlope
int radius
int spacing
QString villager
QHash<QString, QString> workstations

Detailed Description

A later pack's file is read over the earlier ones'; the JSON keys are the names of the fields read.

Member Variable Documentation

int QcVillageSettings::attempts

Places tried in a region for the centre before the region stays empty.

QString QcVillageSettings::bell

The meeting point block (the bell).

double QcVillageSettings::chance

Chance that a region with suitable ground gets a village.

QcVillageGolemSettings QcVillageSettings::golem

The golems of villages whose style names none.

int QcVillageSettings::lampSpacing

Blocks between two lamps along a road.

int QcVillageSettings::maxHeightSpread

Largest height difference of the ground around the centre.

int QcVillageSettings::maxPieceSlope

Largest height difference of the ground under one piece.

int QcVillageSettings::radius

Pieces stand at most this far from the centre (also the road length).

int QcVillageSettings::spacing

Edge of the square regions in blocks; each region holds at most one village, always inside it.

QString QcVillageSettings::villager

The creature kind living in villages whose style names none (a mob with "villager").

QHash<QString, QString> QcVillageSettings::workstations

Block name -> workstation kind (the name of the profession working there): the village state lists these blocks. Filled from the professions (QcContentRegistry::finish), not read.