QcCoastalTowerGenerator Class
Builds the coastal towers of the terrain generator into its chunks (decision E-605): each chunk writes its own cells of the tower of every region it overlaps (a tower stays inside its region; QcCoastalTowerPlanner, plans cached by region), in any order with the same result. More...
| Header: | #include <worldgen/towers/QcCoastalTowerGenerator.h> |
Public Functions
| void | build(QcChunk &chunk) const |
| QList<QcXzRect> | footprintsNear(QcChunkPos pos, int margin) const |
| QcChunkFurnishing | furnishingIn(QcChunkPos pos) const |
| std::shared_ptr<const QcCoastalTowerPlan> | planOf(int regionX, int regionZ) const |
| const QcCoastalTowerPlanner & | planner() const |
| QList<std::shared_ptr<const QcCoastalTowerPlan>> | plansTouching(QcChunkPos pos) const |
Detailed Description
Under the footprint the foundation block fills everything that is not ground from below the floor down to the ground (at most maxFoundation blocks); above the floor the footprint is cleared (trees, plants) up to a few blocks over the structure, which is then written; no trees, plants or surface pools grow near a tower (footprintsNear()), so none is cut or left floating. The chests' loot and spawners of the structure come with furnishingIn(). Thread-safe.
Member Function Documentation
void QcCoastalTowerGenerator::build(QcChunk &chunk) const
Writes the cells of the towers touching chunk into it, with their foundations, cleared columns and the opening in front of the door. Builds after the terrain's features and surface pools, before the villages.
QList<QcXzRect> QcCoastalTowerGenerator::footprintsNear(QcChunkPos pos, int margin) const
Returns the footprints of the towers within margin columns of the chunk pos: the terrain generator places no features and no surface pools there, like near surface structures.
QcChunkFurnishing QcCoastalTowerGenerator::furnishingIn(QcChunkPos pos) const
Returns the chests (with their loot tables and seeds) and spawners of the towers' structures in the chunk pos.
std::shared_ptr<const QcCoastalTowerPlan> QcCoastalTowerGenerator::planOf(int regionX, int regionZ) const
Returns the tower of the region regionX, regionZ, planned once (null without one): the planner's, unless a neighbouring region's of higher priority stands closer than minDistance (decision E-857).
const QcCoastalTowerPlanner &QcCoastalTowerGenerator::planner() const
Returns the planner whose towers this generator builds.
QList<std::shared_ptr<const QcCoastalTowerPlan>> QcCoastalTowerGenerator::plansTouching(QcChunkPos pos) const
Returns the towers whose cells may lie in the chunk pos (their footprint or the doorstep beside it).