QcMineshaftSite Class
What the terrain of one region allows a mine shaft (decision E-570), from the terrain noise alone (columns and caves, never generated chunks) and the dungeons planned nearby: a node, corridor or room fits where enough ground lies above it and no dungeon is in the way; its floor bridges a cave where the noise says it is open, and then every pillar it needs reaches solid ground within maxPillar blocks. More...
| Header: | #include <worldgen/mineshafts/QcMineshaftSite.h> |
Public Types
Public Functions
| bool | awayFromSettlements(int x, int z, int margin) const |
| bool | cave(QcBlockPos pos) |
| bool | clearOfDungeons(QcBlockPos low, QcBlockPos high) const |
| const QcTerrainColumn & | column(int x, int z) |
| QcMineshaftSite::Verdict | corridor(const QcMineshaftPlan::Corridor &corridor) |
| QcMineshaftSite::Verdict | node(const QcMineshaftPlan::Node &node) |
| bool | roomFits(const QcMineshaftPlan::Node &node, int half, int height) |
Detailed Description
Staircases and the central room need a solid floor. Columns are looked up once; one site serves one plan on one thread.
Member Type Documentation
[alias] QcMineshaftSite::Verdict
Whether an element may be made, and whether it bridges a cave.
Member Function Documentation
bool QcMineshaftSite::awayFromSettlements(int x, int z, int margin) const
Returns whether no village lies within margin blocks of the column x, z, nor a surface structure or the ground blended around it (decision E-889): where an entrance may come up.
bool QcMineshaftSite::cave(QcBlockPos pos)
Returns whether the terrain noise carves a cave at pos.
bool QcMineshaftSite::clearOfDungeons(QcBlockPos low, QcBlockPos high) const
Returns whether the box of cells low to high (inclusive corners), grown by one cell, is clear of every dungeon nearby.
const QcTerrainColumn &QcMineshaftSite::column(int x, int z)
Returns the terrain column at x, z, looked up once and then cached.
QcMineshaftSite::Verdict QcMineshaftSite::corridor(const QcMineshaftPlan::Corridor &corridor)
Returns whether corridor fits (clear of dungeons, enough ground above every lane) and whether its floor bridges a cave; a staircase never bridges, and a bridge fits only where the pillars of its supports reach the ground.
QcMineshaftSite::Verdict QcMineshaftSite::node(const QcMineshaftPlan::Node &node)
Returns whether node fits (enough ground above its middle and corners, clear of dungeons) and whether its floor bridges a cave; a bridge fits only where the pillar under its middle reaches the ground (or the middle stands on ground).
bool QcMineshaftSite::roomFits(const QcMineshaftPlan::Node &node, int half, int height)
Returns whether a room half cells on each side of the middle of node and height cells high fits: enough ground above its middle and corners, clear of dungeons, and a solid floor everywhere (the central room and rooms from structures).