QtCraft API C++ classes QML types Handbook

QcGiantTreePlacer Class

Giant trees on a 2×2 trunk (decision E-822): each cell of QcTerrainDefinitions::giantCell blocks (aligned with the chunks) holds at most one, with the chance of the biome at a random spot in it, on dry, level ground the tree may stand on and that no cave opened. More...

Header: #include <worldgen/terrain/QcGiantTreePlacer.h>

Public Types

struct Giant

Public Functions

void build(QcChunk &chunk, const QcVillagePlan *village) const
QList<QcGiantTreePlacer::Giant> giantsNear(QcChunkPos pos) const

Static Public Members

const int maxReach

Detailed Description

Decided from the columns alone, so every chunk a crown reaches into sees the same trees. Thread-safe (only reads).

Member Function Documentation

void QcGiantTreePlacer::build(QcChunk &chunk, const QcVillagePlan *village) const

Builds the giants reaching into chunk, none near village (may be null) or a surface structure or coastal tower.

QList<QcGiantTreePlacer::Giant> QcGiantTreePlacer::giantsNear(QcChunkPos pos) const

Returns the giants whose crowns may reach into the chunk at pos (villages and structures not checked).

Member Variable Documentation

const int QcGiantTreePlacer::maxReach

How far a giant reaches sideways from its base, at most.