Table of Contents

Class ChunkRenderCache

Namespace
TileWorld.Engine.Render
Assembly
TileWorld.Engine.dll

Stores render commands generated for a single chunk.

public sealed class ChunkRenderCache
Inheritance
ChunkRenderCache
Inherited Members

Remarks

This API is intended for engine infrastructure and advanced tooling. Most callers should prefer WorldRenderer instead of managing chunk render caches directly.

Constructors

ChunkRenderCache(ChunkCoord, bool, int, RectI, IReadOnlyList<SpriteDrawCommand>, IReadOnlyList<SpriteDrawCommand>)

Creates a chunk render cache snapshot.

public ChunkRenderCache(ChunkCoord coord, bool isBuilt, int lastBuildTick, RectI worldPixelBounds, IReadOnlyList<SpriteDrawCommand> backgroundCommands, IReadOnlyList<SpriteDrawCommand> foregroundCommands)

Parameters

coord ChunkCoord

The chunk coordinate represented by the cache.

isBuilt bool

Whether the cache contains valid draw commands.

lastBuildTick int

The monotonic build tick that produced the cache.

worldPixelBounds RectI

The world-space pixel bounds covered by the chunk.

backgroundCommands IReadOnlyList<SpriteDrawCommand>

The background-wall draw commands generated for the chunk.

foregroundCommands IReadOnlyList<SpriteDrawCommand>

The foreground draw commands generated for the chunk.

Properties

BackgroundCommands

Gets the background-wall draw commands generated for the chunk.

public IReadOnlyList<SpriteDrawCommand> BackgroundCommands { get; }

Property Value

IReadOnlyList<SpriteDrawCommand>

Coord

Gets the chunk coordinate represented by this cache.

public ChunkCoord Coord { get; }

Property Value

ChunkCoord

ForegroundCommands

Gets the foreground draw commands generated for the chunk.

public IReadOnlyList<SpriteDrawCommand> ForegroundCommands { get; }

Property Value

IReadOnlyList<SpriteDrawCommand>

IsBuilt

Gets a value indicating whether the cache contains valid draw commands.

public bool IsBuilt { get; }

Property Value

bool

LastBuildTick

Gets the monotonic build tick that produced this cache.

public int LastBuildTick { get; }

Property Value

int

WorldPixelBounds

Gets the world-space pixel bounds covered by the chunk.

public RectI WorldPixelBounds { get; }

Property Value

RectI