Class FloorIdGridSection
- Namespace
- LlamaLogic.Architecture
- Assembly
- LlamaLogic.Architecture.dll
Represents one of the seven floor id grids: the FloorKeysSection id painted on each quarter of each tile (🔓)
public sealed class FloorIdGridSection : LotArchitectureSection
- Inheritance
-
FloorIdGridSection
- Inherited Members
Remarks
The grid has SizeX × SizeZ tiles per layer and four ids per tile, one per FloorQuarter. Each id is a Id of the lot's FloorKeysSection, whose key is a CTProductFloorPattern (0xB4F762C9); 0 means no floor.
The types Floors, Ceilings, PoolSurfaces, SecondaryFloors and CeilingPaints have one layer per level of the lot (HasLevels), indexed by level − LowestLevel, so ground level is index −LowestLevel. TerrainFloors and PondBottoms have a single layer, for ground level. When the lot's Version is 8 or less, PoolSurfaces also has a single layer, for ground level.
Roles proven by the game's code and in-game tests: Floors is the floor pattern of each level, TerrainFloors the floor pattern painted on bare terrain, PondBottoms the pond bottom pattern and CeilingPaints the ceiling paint. In-game tests show that building a room fills Ceilings at the level above the room over exactly the room's tiles (and painting the ceiling changes only CeilingPaints), and that building a pool fills PoolSurfaces over exactly the pool's tiles at the level above the pool's block; the game's code assigns both grids to the room on the level below their layer. In-game tests show that building a room or a platform fills SecondaryFloors over its tiles with the lot's default floor key, and that painting a floor or a platform's top changes only Floors; the role of SecondaryFloors, which covers the same quarters as Floors, is still unknown.
The layers are stored one after another, each as SizeX rows of SizeZ tiles of four little-endian 16-bit ids; the section has no version.
Constructors
FloorIdGridSection(LotArchitectureSectionType, int, int, int)
Initializes a new instance of the FloorIdGridSection class with every id 0
public FloorIdGridSection(LotArchitectureSectionType type, int sizeX, int sizeZ, int levelCount)
Parameters
typeLotArchitectureSectionTypeThe type of the section, which must be one of the floor id 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 id 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 TerrainFloors and PondBottoms do
public bool HasLevels { get; }
Property Value
Remarks
A PoolSurfaces grid of a lot whose Version is 8 or less has levels but only one layer, for ground level.
this[int, int, int, FloorQuarter]
Gets/sets the floor key id of a quarter of a tile
public ushort 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, or
quarteris not a FloorQuarter
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; }