QtCraft API C++ classes QML types Handbook

QcBoardwalkPlanner Namespace

The ground of a village over water (decision E-407), from the terrain noise alone like the rest of a village plan: pieces and boardwalks lie at one floor height above the water surface, wherever the ground lies between the floor and a few blocks below the water surface, with posts every few cells down to the bottom, and stairs lead from a boardwalk's end down to dry land. More...

Header: #include <worldgen/villages/QcBoardwalkPlanner.h>

Classes

struct End

Functions

bool carries(const QcTerrainGenerator &terrain, const QcVillageStyle::Stilts &stilts, const QcTerrainColumn &column)
bool carries(const QcTerrainGenerator &terrain, const QcVillageStyle::Stilts &stilts, int x, int z)
QcVillagePlan::Deck deck(const QcTerrainGenerator &terrain, const QcVillageStyle::Stilts &stilts, std::pair<int, int> column, QcBlockId block)
std::optional<int> floorFor(const QcTerrainGenerator &terrain, const QcVillageStyle::Stilts &stilts, std::pair<int, int> low, std::pair<int, int> high)
int floorY(const QcTerrainGenerator &terrain, const QcVillageStyle::Stilts &stilts)
QList<QcVillagePlan::Deck> stairs(const QcTerrainGenerator &terrain, const QcContentRegistry &content, const QcVillageStyle::Stilts &stilts, const QcBoardwalkPlanner::End &end)
std::optional<QcVillageDraft::Stairs> stairsAt(const QcTerrainGenerator &terrain, const QcContentRegistry &content, const QcVillageDraft &draft, const QcVillageDraft::Road &road)
std::optional<int> wetAround(const QcTerrainGenerator &terrain, const QcVillageStyle &style, std::pair<int, int> centre, int reach, int step)

Detailed Description

Classes

class End

The end of a boardwalk: its last cell, its direction and its odd width. More...

Function Documentation

bool QcBoardwalkPlanner::carries(const QcTerrainGenerator &terrain, const QcVillageStyle::Stilts &stilts, const QcTerrainColumn &column)

Returns the same as the overload above for a column of terrain already known, with the style's stilts.

bool QcBoardwalkPlanner::carries(const QcTerrainGenerator &terrain, const QcVillageStyle::Stilts &stilts, int x, int z)

Returns whether a piece or boardwalk can stand over the column at x, z of terrain: its ground lies at most at the floor height and at most maxDepth blocks of stilts below the water surface, and it is no overhang.

QcVillagePlan::Deck QcBoardwalkPlanner::deck(const QcTerrainGenerator &terrain, const QcVillageStyle::Stilts &stilts, std::pair<int, int> column, QcBlockId block)

Returns the boardwalk cell over column (x, z): block at the floor height of terrain and stilts, the post of stilts under it on the grid of every spacing cells in both directions (in world coordinates, so crossing boardwalks share it).

std::optional<int> QcBoardwalkPlanner::floorFor(const QcTerrainGenerator &terrain, const QcVillageStyle::Stilts &stilts, std::pair<int, int> low, std::pair<int, int> high)

Returns the floor height for a piece over the rectangle from low to high (x, z; inclusive corners), sampled at its corners, edge middles and centre; std::nullopt where one of them cannot carry it (carries() with terrain and stilts).

int QcBoardwalkPlanner::floorY(const QcTerrainGenerator &terrain, const QcVillageStyle::Stilts &stilts)

Returns the height of the floor blocks of pieces and boardwalks: stilts.height blocks above the water surface (the block below the sea level of terrain), from the style's stilts.

QList<QcVillagePlan::Deck> QcBoardwalkPlanner::stairs(const QcTerrainGenerator &terrain, const QcContentRegistry &content, const QcVillageStyle::Stilts &stilts, const QcBoardwalkPlanner::End &end)

Returns the stairs from the boardwalk's end straight on down to dry land, one block lower per cell and as wide as the end, the stair block of stilts turned in content to face the boardwalk (up), with posts under them; at most stilts.height rows. Empty where the ground of terrain beyond the end is water or at most a block below the floor (a step up from there reaches the boardwalk).

std::optional<QcVillageDraft::Stairs> QcBoardwalkPlanner::stairsAt(const QcTerrainGenerator &terrain, const QcContentRegistry &content, const QcVillageDraft &draft, const QcVillageDraft::Road &road)

Returns the stairs from the end of the laid boardwalk road of draft down to dry land (stairs() over terrain, turned in content), with the land access the wetland keeps dry (QcVillageDraft::addStairs); std::nullopt where there are no stairs or they leave the region or meet pieces or roads.

std::optional<int> QcBoardwalkPlanner::wetAround(const QcTerrainGenerator &terrain, const QcVillageStyle &style, std::pair<int, int> centre, int reach, int step)

Returns, over water, the number of samples (every step blocks within reach of centre in both directions, from terrain) whose ground lies under water, when at least 60 % of them carry the stilts of style and at least the style's stilts.water share are water; std::nullopt otherwise, and where a sample lies near a river (decision E-841) or in a delta biome (decision E-850).