QcMineshaftAccess Class
The ways into a mine shaft besides its corridors (decision E-570): rooms from structures with a "mineshaft" weight at dead ends (turned so their door faces the corridor), and the surface entrance: a ladder shaft from a corner of the central room up through the ground, lined with planks where it passes something open, under a headframe of posts and a plank roof, or an inclined tunnel (QcMineshaftIncline, decision E-895), the kind drawn by entranceKinds. More...
| Header: | #include <worldgen/mineshafts/QcMineshaftAccess.h> |
Public Types
Public Functions
| std::optional<QcMineshaftPlan::Entrance> | entranceOf(const QcMineshaftPlan &plan, QcMineshaftSite &site, const QcMineshaftFrame &frame, const QcMineshaftAccess::Random &random) const |
| qsizetype | roomKinds() const |
| QList<QcMineshaftPlan::Room> | roomsOf(const QcMineshaftPlan &plan, const QcMineshaftNetwork &network, QcMineshaftSite &site, const QcMineshaftAccess::Random &random) const |
Detailed Description
An entrance is made with the chance of the biome at the shaft; a ladder shaft where the ground's top lies above the sea, the ground around lies level with it (under the headframe within one block, around it at most one higher), no cave opens there and no village is around.
Member Type Documentation
[alias] QcMineshaftAccess::Random
A random value in [0, 1) for a purpose and an index.
Member Function Documentation
std::optional<QcMineshaftPlan::Entrance> QcMineshaftAccess::entranceOf(const QcMineshaftPlan &plan, QcMineshaftSite &site, const QcMineshaftFrame &frame, const QcMineshaftAccess::Random &random) const
Returns the surface entrance of plan, where one may come up (std::nullopt otherwise): with the entrance chance of the biome at the central room's north west corner, the kind drawn by weight from random first and the other where the first finds no place. The ladder shaft rises from that corner of the room (frame), the incline through a side of the room or of a dead end of the top level; site checks the ground.
qsizetype QcMineshaftAccess::roomKinds() const
Returns the number of room structures that fit.
QList<QcMineshaftPlan::Room> QcMineshaftAccess::roomsOf(const QcMineshaftPlan &plan, const QcMineshaftNetwork &network, QcMineshaftSite &site, const QcMineshaftAccess::Random &random) const
Returns the rooms at the dead ends of the laid out plan, at most maxRooms: at each node other than the central room joined by one level corridor of network, with roomChance drawn from random, where no pillar of another level passes and a structure drawn by weight fits in the ground (site).