QtCraft API C++ classes QML types Handbook

QcDungeonPlanner Class

Plans the dungeon of a region (decision E-522) from the seed and the terrain noise: whether the region has one (chance), a place for its room deep below the ground where caves take little of it, the spawner's kind by weight, the chests against the walls, and the corridors to caves within reach (one per side at most, straight or with one bend, the shortest first, at most corridors), with their lining and lights. More...

Header: #include <worldgen/dungeons/QcDungeonPlanner.h>

Public Types

struct Blocks

Public Functions

QcDungeonPlanner(const QcTerrainGenerator &terrain, const QcContentRegistry &content, quint64 seed)
const QcDungeonPlanner::Blocks &blocks() const
bool enabled() const
std::shared_ptr<const QcDungeonPlan> plan(int regionX, int regionZ) const
int reach() const
const QcDungeonSettings &settings() const
const QStringList &warnings() const

Detailed Description

Thread-safe: plan() only reads immutable state.

Member Function Documentation

QcDungeonPlanner::QcDungeonPlanner(const QcTerrainGenerator &terrain, const QcContentRegistry &content, quint64 seed)

Plans with the dungeon settings of content over the noise of terrain, seeded from seed. Unresolvable blocks switch dungeons off with a warning (warnings()).

const QcDungeonPlanner::Blocks &QcDungeonPlanner::blocks() const

Returns the resolved blocks a plan places.

bool QcDungeonPlanner::enabled() const

Returns whether dungeons are planned: enabled in the settings, every block known and at least one creature for the spawner.

std::shared_ptr<const QcDungeonPlan> QcDungeonPlanner::plan(int regionX, int regionZ) const

Returns the dungeon of the region regionX, regionZ; null without one.

int QcDungeonPlanner::reach() const

Returns how far beyond its region a dungeon may reach (room, corridors and lining).

const QcDungeonSettings &QcDungeonPlanner::settings() const

Returns the dungeon settings of the content.

const QStringList &QcDungeonPlanner::warnings() const

Returns the problems found while resolving the settings' blocks.