QtCraft API C++ classes QML types Handbook

QcMapSurvey Namespace

How a map is revealed (decision E-800), as in the reference: a player holding a map looks at the pixels within revealRadius blocks of where it stands, each tick at every sweep-th column of pixels (another one each tick), so a map fills in over sweep ticks while its holder walks and each tick costs little. More...

Header: #include <server/maps/QcMapSurvey.h>

Classes

struct Surveyed

Variables

const int deepWater
const int revealRadius
const int sweep

Functions

std::optional<quint16> pixelOf(const QcServerWorld &world, const QcMapData &map, QPoint pixel)
QList<QPoint> pixelsDue(const QcMapData &map, QPointF holder, quint64 tick)
QList<QcMapSurvey::Surveyed> survey(const QcServerWorld &world, const QcMapData &map, const QList<QPoint> &pixels)

Detailed Description

A pixel shows the most common top block of the columns it covers (one column at scale 0; blocks drawn nowhere, like the barrier, are looked through; no block at all: blank). Land is shaded by the mean height of its columns against the pixel north of it (flat when that one is blank or not loaded), water by the mean liquid depth over the pixel's columns, both with a fine checker pattern that deep water no longer shows; pixels with a column in a chunk that is not loaded stay as they are.

Classes

class Surveyed

One pixel looked at: where it is and what it shows now (QcMapPixel). More...

Variable Documentation

const int QcMapSurvey::deepWater

Water this deep or deeper counts as deep (no checker pattern any more).

const int QcMapSurvey::revealRadius

A holder looks at the pixels within this many blocks of where it stands.

const int QcMapSurvey::sweep

Each tick a holder looks at every sweep-th column of pixels (by the tick), so a map fills in over sweep ticks.

Function Documentation

std::optional<quint16> QcMapSurvey::pixelOf(const QcServerWorld &world, const QcMapData &map, QPoint pixel)

Returns what pixel pixel of map shows now in world (QcMapPixel); std::nullopt when a chunk it covers is not loaded.

QList<QPoint> QcMapSurvey::pixelsDue(const QcMapData &map, QPointF holder, quint64 tick)

Returns the pixels of map that a holder standing at holder (block x, z) looks at in tick tick.

QList<QcMapSurvey::Surveyed> QcMapSurvey::survey(const QcServerWorld &world, const QcMapData &map, const QList<QPoint> &pixels)

Returns what pixels of map (in the order of pixelsDue) show now in world, leaving out those over unloaded chunks; the columns of a pixel are counted once, also as the north neighbour of the pixel after it.