QtCraft API C++ classes QML types Handbook

QcVillageLayout Struct

One street plan the villages of a style are laid out with (decision E-408), chosen per village by weight. More...

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

Public Types

enum class Kind { Cross, Street, Tee, Ell, Plaza, Tree }

Public Variables

QcVillageRange<double> armLength
QcVillageRange<int> arms
QcVillageRange<int> bends
double branchChance
int branchEvery
QcVillageRange<double> branchLength
bool diagonals
QcVillageRange<int> exits
QcVillageLayout::Kind kind
QcVillageRange<int> ring
int weight
double winding

Detailed Description

Roads are three blocks wide and run in one of eight directions (diagonals as staircases); lengths are shares of the village radius (QcVillageSettings::radius).

Member Type Documentation

enum class QcVillageLayout::Kind

The kind of plan ("kind": cross, street, t, l, plaza or tree).

ConstantValueDescription
QcVillageLayout::Kind::Cross0Four roads from the centre, one to each side.
QcVillageLayout::Kind::Street1One long main road through the centre with side roads off it.
QcVillageLayout::Kind::Tee2Three roads from the centre (two opposite, one across).
QcVillageLayout::Kind::Ell3Two roads from the centre at a right angle.
QcVillageLayout::Kind::Plaza4A ring road around a square with the centre and a road to it, roads out from the ring.
QcVillageLayout::Kind::Tree5Arms at random angles, each bending once or twice.

Member Variable Documentation

QcVillageRange<double> QcVillageLayout::armLength

A road from the centre (or from the ring) is this share of the radius long.

bool QcVillageLayout::diagonals

Roads may run diagonally (street, tree); a style over water never does.

QcVillageLayout::Kind QcVillageLayout::kind

The kind of plan; its own defaults fill the parameters the data leaves out.

int QcVillageLayout::weight

Relative chance against the other layouts of the style ("weight", 1..1000).

double QcVillageLayout::winding

Chance per village that its roads wind with the terrain (towards the flatter neighbouring direction, at most 45 degrees off their heading); needs diagonals.