Table of Contents

Struct ObjectPlacementResult

Namespace
TileWorld.Engine.Runtime.Objects
Assembly
TileWorld.Engine.dll

Represents the outcome of an object placement request.

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

Constructors

ObjectPlacementResult(bool, ObjectPlacementErrorCode, int, int, WorldTileCoord, ChunkDirtyFlags)

Represents the outcome of an object placement request.

public ObjectPlacementResult(bool Success, ObjectPlacementErrorCode ErrorCode, int ObjectInstanceId, int ObjectDefId, WorldTileCoord AnchorCoord, ChunkDirtyFlags DirtyFlagsApplied)

Parameters

Success bool

Whether the placement completed successfully.

ErrorCode ObjectPlacementErrorCode

The failure reason when Success is false.

ObjectInstanceId int

The created object instance identifier when placement succeeds.

ObjectDefId int

The placed object definition identifier.

AnchorCoord WorldTileCoord

The logical anchor coordinate targeted by the request.

DirtyFlagsApplied ChunkDirtyFlags

The dirty flags applied to affected chunks.

Properties

AnchorCoord

The logical anchor coordinate targeted by the request.

public WorldTileCoord AnchorCoord { get; init; }

Property Value

WorldTileCoord

DirtyFlagsApplied

The dirty flags applied to affected chunks.

public ChunkDirtyFlags DirtyFlagsApplied { get; init; }

Property Value

ChunkDirtyFlags

ErrorCode

The failure reason when Success is false.

public ObjectPlacementErrorCode ErrorCode { get; init; }

Property Value

ObjectPlacementErrorCode

ObjectDefId

The placed object definition identifier.

public int ObjectDefId { get; init; }

Property Value

int

ObjectInstanceId

The created object instance identifier when placement succeeds.

public int ObjectInstanceId { get; init; }

Property Value

int

Success

Whether the placement completed successfully.

public bool Success { get; init; }

Property Value

bool

Methods

Failed(ObjectPlacementErrorCode, int, WorldTileCoord)

Creates a failed object-placement result.

public static ObjectPlacementResult Failed(ObjectPlacementErrorCode errorCode, int objectDefId, WorldTileCoord anchorCoord)

Parameters

errorCode ObjectPlacementErrorCode

The failure reason.

objectDefId int

The requested object definition identifier.

anchorCoord WorldTileCoord

The logical anchor coordinate targeted by the request.

Returns

ObjectPlacementResult

A failed object-placement result.

Succeeded(int, int, WorldTileCoord, ChunkDirtyFlags)

Creates a successful object-placement result.

public static ObjectPlacementResult Succeeded(int objectInstanceId, int objectDefId, WorldTileCoord anchorCoord, ChunkDirtyFlags dirtyFlagsApplied)

Parameters

objectInstanceId int

The created object instance identifier.

objectDefId int

The placed object definition identifier.

anchorCoord WorldTileCoord

The logical anchor coordinate targeted by the request.

dirtyFlagsApplied ChunkDirtyFlags

The dirty flags applied to affected chunks.

Returns

ObjectPlacementResult

A successful object-placement result.