QtCraft API C++ classes QML types Handbook

QcXzRect Struct

A rectangle of columns (or of other cells on the x-z plane, such as regions) from (minX, minZ) to (maxX, maxZ), both corners inclusive. More...

Header: #include <common/core/QcXzRect.h>

Public Functions

QList<QcChunkPos> chunks() const
bool contains(int x, int z) const
QcXzRect grown(int margin) const
bool intersects(QcXzRect other, int gap = 0) const
int middleX() const
int middleZ() const

Public Variables

int maxX
int maxZ
int minX
int minZ

Detailed Description

Footprints of structures, village areas and the areas a generator or the server looks at share this type (decision E-975).

Member Function Documentation

QList<QcChunkPos> QcXzRect::chunks() const

Returns the chunks the columns lie in, row by row from the north-west.

bool QcXzRect::contains(int x, int z) const

Returns whether the column x, z lies in the rectangle.

QcXzRect QcXzRect::grown(int margin) const

Returns the rectangle grown by margin columns on every side.

bool QcXzRect::intersects(QcXzRect other, int gap = 0) const

Returns whether other lies within gap columns of this rectangle (0: they share at least one column).

int QcXzRect::middleX() const

Returns the middle column along x, summed in 64 bits: near the edge of the world (E-883) two corners add up beyond int.

int QcXzRect::middleZ() const

Returns the middle row along z, summed in 64 bits like middleX().

Member Variable Documentation

int QcXzRect::maxX

The highest x (east edge), inside.

int QcXzRect::maxZ

The highest z (south edge), inside.

int QcXzRect::minX

The lowest x (west edge), inside.

int QcXzRect::minZ

The lowest z (north edge), inside.