QcVillageRoads Namespace
The road surfaces of a village (decision E-406): one surface per rank chosen from the style, and slabs where a road steps up by one block, so terraced ground reads as a stair. More...
| Header: | #include <worldgen/villages/QcVillageRoads.h> |
Functions
| const QcVillageStyle::Road & | choose(const QList<QcVillageStyle::Road> &roads, double random) |
| QList<QcPlacedBlock> | steps(const QcVillagePlan &plan, QcBlockId step, QcBlockId branchStep) |
Detailed Description
Pure functions of the plan, like the rest of it.
Function Documentation
const QcVillageStyle::Road &QcVillageRoads::choose(const QList<QcVillageStyle::Road> &roads, double random)
Returns one of roads (not empty) by weight; random in [0, 1).
QList<QcPlacedBlock> QcVillageRoads::steps(const QcVillagePlan &plan, QcBlockId step, QcBlockId branchStep)
Returns the steps of the roads of plan: every road cell with a neighbouring road cell (of either rank) exactly one block higher gets its rank's step on top (step for the roads from the centre, branchStep for the side roads), unless that is air. Where the ranks share a column the road from the centre counts. Sorted by x, then z.