QtCraft API C++ classes QML types Handbook

QcPathGap Struct

Where a body goes through the cell of an open door or trapdoor (decision E-905): per horizontal axis, the free opening beside its panel; none along an axis that nothing narrows. More...

Header: #include <server/pathing/QcPathCells.h>

Public Functions

bool coversSide(int dx, int dz) const
float narrowest() const
bool narrows() const
QcPathGap within(const QcPathGap &other) const

Public Variables

std::optional<QcPathOpening> x
std::optional<QcPathOpening> z

Detailed Description

A panel narrows the axis across it: an open door's leaf standing along z narrows x.

Member Function Documentation

bool QcPathGap::coversSide(int dx, int dz) const

Returns whether a panel covers the side of the cell towards dx, dz (one of them 1 or -1, the other 0): a body does not cross that side of the cell (the leaf of a free-standing open door).

float QcPathGap::narrowest() const

Returns the narrowest opening of the narrowed axes (1 without any): a body wider than it does not fit through the cell (decision E-909).

bool QcPathGap::narrows() const

Returns whether a panel narrows an axis.

QcPathGap QcPathGap::within(const QcPathGap &other) const

Returns this gap and other at once (a body in two cells): the openings within each other along each axis.

Member Variable Documentation

std::optional<QcPathOpening> QcPathGap::x

The opening along x, if a panel narrows it.

std::optional<QcPathOpening> QcPathGap::z

The opening along z, if a panel narrows it.