Class FloorRotationGridSection
- Namespace
- LlamaLogic.Architecture
- Assembly
- LlamaLogic.Architecture.dll
Represents one of the five floor rotation grids: the rotation of the pattern on each quarter of each tile of a FloorIdGridSection (🔓)
public sealed class FloorRotationGridSection : LotArchitectureSection
- Inheritance
-
FloorRotationGridSection
- Inherited Members
Remarks
The grid has SizeX × SizeZ tiles per layer and one rotation of 0 through 3 per FloorQuarter. A rotation is the number of 90° clockwise turns of the pattern, as seen in game: rotating one floor tile by 90° changed all four of its quarters from 0 to 1, and so did turning a terrain floor tile 90° clockwise (in-game tests). Each grid is paired with a floor id grid: FloorRotations with Floors, CeilingRotations with Ceilings, SecondaryFloorRotations with SecondaryFloors, CeilingPaintRotations with CeilingPaints and TerrainFloorRotations with TerrainFloors; FloorIdGridSection describes the roles of the id grids and the in-game tests and code that show them.
All types but TerrainFloorRotations have one layer per level of the lot (HasLevels), indexed by level − LowestLevel; TerrainFloorRotations has a single layer, for ground level.
The layers are stored one after another, each as SizeX rows of SizeZ bytes; each byte holds the four rotations of a tile, two bits each, the NegativeZ quarter in the lowest bits, as the game's getter and setter read and write them. The section has no version.
Constructors
FloorRotationGridSection(LotArchitectureSectionType, int, int, int)
Initializes a new instance of the FloorRotationGridSection class with every rotation 0
public FloorRotationGridSection(LotArchitectureSectionType type, int sizeX, int sizeZ, int levelCount)
Parameters
typeLotArchitectureSectionTypeThe type of the section, which must be one of the floor rotation grid types
sizeXintThe number of tiles along the lot's local X axis
sizeZintThe number of tiles along the lot's local Z axis
levelCountintThe number of layers: the lot's level count, or 1 for a grid with a single layer
Exceptions
- ArgumentException
typeis not a floor rotation grid type- ArgumentOutOfRangeException
sizeX,sizeZorlevelCountis not 0 through 255, orlevelCountis not 1 for a type with no levels
Properties
HasLevels
Gets whether the grid has one layer per level of the lot, which all types but TerrainFloorRotations do
public bool HasLevels { get; }
Property Value
this[int, int, int, FloorQuarter]
Gets/sets the rotation of the pattern on a quarter of a tile, as the number of 90° clockwise turns
public byte this[int x, int z, int levelIndex, FloorQuarter quarter] { get; set; }
Parameters
xintThe tile's index along the lot's local X axis
zintThe tile's index along the lot's local Z axis
levelIndexintThe layer: the level − LowestLevel, or 0 for a grid with a single layer
quarterFloorQuarterThe quarter of the tile
Property Value
Exceptions
- ArgumentOutOfRangeException
A coordinate is outside the grid,
quarteris not a FloorQuarter, or the rotation being set is not 0 through 3
LevelCount
Gets the number of layers of the grid
public int LevelCount { get; }
Property Value
SizeX
Gets the number of tiles of the grid along the lot's local X axis
public int SizeX { get; }
Property Value
SizeZ
Gets the number of tiles of the grid along the lot's local Z axis
public int SizeZ { get; }