Struct TileEditResult
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
SuccessboolWhether the edit operation completed successfully.
ErrorCodeTileEditErrorCodeThe failure reason when
Successis false.CoordWorldTileCoordThe world-tile coordinate targeted by the edit.
PreviousTileIdushortThe foreground tile identifier before the edit.
CurrentTileIdushortThe foreground tile identifier after the edit.
DirtyFlagsAppliedChunkDirtyFlagsThe 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
CurrentTileId
The foreground tile identifier after the edit.
public ushort CurrentTileId { get; init; }
Property Value
DirtyFlagsApplied
The dirty flags applied as part of the edit.
public ChunkDirtyFlags DirtyFlagsApplied { get; init; }
Property Value
ErrorCode
The failure reason when Success is false.
public TileEditErrorCode ErrorCode { get; init; }
Property Value
PreviousTileId
The foreground tile identifier before the edit.
public ushort PreviousTileId { get; init; }
Property Value
Success
Whether the edit operation completed successfully.
public bool Success { get; init; }
Property Value
Methods
Failed(TileEditErrorCode, WorldTileCoord, ushort)
Creates a failed tile-edit result.
public static TileEditResult Failed(TileEditErrorCode errorCode, WorldTileCoord coord, ushort previousTileId = 0)
Parameters
errorCodeTileEditErrorCodeThe failure reason.
coordWorldTileCoordThe world-tile coordinate targeted by the edit.
previousTileIdushortThe 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
coordWorldTileCoordThe world-tile coordinate targeted by the edit.
previousTileIdushortThe foreground tile identifier before the edit.
currentTileIdushortThe foreground tile identifier after the edit.
dirtyFlagsAppliedChunkDirtyFlagsThe dirty flags applied as part of the edit.
Returns
- TileEditResult
A successful tile-edit result.