QcStateRotation Namespace
Turns block states with a structure (decision E-219): turns quarter turns clockwise seen from above (north becomes east). More...
| Header: | #include <worldgen/structures/QcStateRotation.h> |
Functions
| QcBlockId | turned(const QcContentRegistry &content, QcBlockId state, int turns) |
| QString | turnedDirection(const QString &direction, int turns) |
Detailed Description
Any property value "north", "east", "south" or "west" turns along (facing, attach), the connection properties named after the four sides swap their values (fences, walls, panes) and "axis" swaps x and z on odd turns (logs), and a "rotation" with 16 values (a standing sign's sixteenths of a turn) adds four per turn. Other properties stay. A turned value the block does not have keeps the old one, with a warning once per block and value.
Function Documentation
QcBlockId QcStateRotation::turned(const QcContentRegistry &content, QcBlockId state, int turns)
Returns the block state state of content turned by turns quarter turns clockwise; an invalid state, or a multiple of four turns, comes back unchanged.
QString QcStateRotation::turnedDirection(const QString &direction, int turns)
Returns direction ("north", "east", "south" or "west") turned by turns quarter turns clockwise (negative turns go counter-clockwise); any other text comes back unchanged.