QtCraft API C++ classes QML types Handbook

QcSpawnAreas Class

The spawn areas of structures around the living players (decision E-871, the original game's spawn overrides): in the footprint of a witch hut over the whole height of the world the natural monster spawns bring forth only witches, by the monsters' rules of light, ground, distance and cap (QcNaturalSpawner). More...

Header: #include <server/spawning/QcSpawnAreas.h>

Public Types

struct Area

Public Functions

const QList<QcSpawnAreas::Area> &areas() const
const QcSpawnAreas::Area *at(int x, int z) const
void refresh(QcServerWorld &world, const QList<QcMobExchange::PlayerView> &players)

Static Public Members

const int reach
const int refreshTicks
QcMobDefinition::SpawnRule ruleOf(const QcMobDefinition &definition)

Detailed Description

Every refreshTicks calls it asks the world generator for the areas within the monster areas of the players (QcWorldGenerator::plannedStructureSitesNear, from its plans; around a player whose regions are not all planned yet they are planned on a generation thread, the areas it had stay meanwhile, and the new ones come with a later refresh). Nothing is saved.

Member Function Documentation

const QList<QcSpawnAreas::Area> &QcSpawnAreas::areas() const

Returns every area known.

const QcSpawnAreas::Area *QcSpawnAreas::at(int x, int z) const

Returns the area whose footprint holds the column at x, z, if any.

void QcSpawnAreas::refresh(QcServerWorld &world, const QList<QcMobExchange::PlayerView> &players)

Called once a tick by the monster pass: every refreshTicks calls the areas of world around players.

[static] QcMobDefinition::SpawnRule QcSpawnAreas::ruleOf(const QcMobDefinition &definition)

Returns the rule a monster of definition spawns by in an area: its main rule without biomes, time, chunk share, height limit, sky or water condition and with weight 1; its light test and ground stay.

Member Variable Documentation

const int QcSpawnAreas::reach

How far from a player areas are looked for: the edge of its monster area (QcMonsterCap).

const int QcSpawnAreas::refreshTicks

Ticks between two refreshes.