Table of Contents

Struct TileEditResult

Namespace
TileWorld.Engine.Runtime.Edits
Assembly
TileWorld.Engine.dll

Represents the outcome of a tile editing operation.

public readonly record struct TileEditResult : IEquatable<TileEditResult>
Implements
Inherited Members

Constructors

TileEditResult(bool, TileEditErrorCode, WorldTileCoord, ushort, ushort, ChunkDirtyFlags)

Represents the outcome of a tile editing operation.

public TileEditResult(bool Success, TileEditErrorCode ErrorCode, WorldTileCoord Coord, ushort PreviousTileId, ushort CurrentTileId, ChunkDirtyFlags DirtyFlagsApplied)

Parameters

Success bool

Whether the edit operation completed successfully.

ErrorCode TileEditErrorCode

The failure reason when Success is false.

Coord WorldTileCoord

The world-tile coordinate targeted by the edit.

PreviousTileId ushort

The foreground tile identifier before the edit.

CurrentTileId ushort

The foreground tile identifier after the edit.

DirtyFlagsApplied ChunkDirtyFlags

The dirty flags applied as part of the edit.

Properties

Coord

The world-tile coordinate targeted by the edit.

public WorldTileCoord Coord { get; init; }

Property Value

WorldTileCoord

CurrentTileId

The foreground tile identifier after the edit.

public ushort CurrentTileId { get; init; }

Property Value

ushort

DirtyFlagsApplied

The dirty flags applied as part of the edit.

public ChunkDirtyFlags DirtyFlagsApplied { get; init; }

Property Value

ChunkDirtyFlags

ErrorCode

The failure reason when Success is false.

public TileEditErrorCode ErrorCode { get; init; }

Property Value

TileEditErrorCode

PreviousTileId

The foreground tile identifier before the edit.

public ushort PreviousTileId { get; init; }

Property Value

ushort

Success

Whether the edit operation completed successfully.

public bool Success { get; init; }

Property Value

bool

Methods

Failed(TileEditErrorCode, WorldTileCoord, ushort)

Creates a failed tile-edit result.

public static TileEditResult Failed(TileEditErrorCode errorCode, WorldTileCoord coord, ushort previousTileId = 0)

Parameters

errorCode TileEditErrorCode

The failure reason.

coord WorldTileCoord

The world-tile coordinate targeted by the edit.

previousTileId ushort

The foreground tile identifier that was present before the failed edit.

Returns

TileEditResult

A failed tile-edit result.

Succeeded(WorldTileCoord, ushort, ushort, ChunkDirtyFlags)

Creates a successful tile-edit result.

public static TileEditResult Succeeded(WorldTileCoord coord, ushort previousTileId, ushort currentTileId, ChunkDirtyFlags dirtyFlagsApplied)

Parameters

coord WorldTileCoord

The world-tile coordinate targeted by the edit.

previousTileId ushort

The foreground tile identifier before the edit.

currentTileId ushort

The foreground tile identifier after the edit.

dirtyFlagsApplied ChunkDirtyFlags

The dirty flags applied as part of the edit.

Returns

TileEditResult

A successful tile-edit result.