Struct ObjectPlacementResult
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
SuccessboolWhether the placement completed successfully.
ErrorCodeObjectPlacementErrorCodeThe failure reason when
Successis false.ObjectInstanceIdintThe created object instance identifier when placement succeeds.
ObjectDefIdintThe placed object definition identifier.
AnchorCoordWorldTileCoordThe logical anchor coordinate targeted by the request.
DirtyFlagsAppliedChunkDirtyFlagsThe dirty flags applied to affected chunks.
Properties
AnchorCoord
The logical anchor coordinate targeted by the request.
public WorldTileCoord AnchorCoord { get; init; }
Property Value
DirtyFlagsApplied
The dirty flags applied to affected chunks.
public ChunkDirtyFlags DirtyFlagsApplied { get; init; }
Property Value
ErrorCode
The failure reason when Success is false.
public ObjectPlacementErrorCode ErrorCode { get; init; }
Property Value
ObjectDefId
The placed object definition identifier.
public int ObjectDefId { get; init; }
Property Value
ObjectInstanceId
The created object instance identifier when placement succeeds.
public int ObjectInstanceId { get; init; }
Property Value
Success
Whether the placement completed successfully.
public bool Success { get; init; }
Property Value
Methods
Failed(ObjectPlacementErrorCode, int, WorldTileCoord)
Creates a failed object-placement result.
public static ObjectPlacementResult Failed(ObjectPlacementErrorCode errorCode, int objectDefId, WorldTileCoord anchorCoord)
Parameters
errorCodeObjectPlacementErrorCodeThe failure reason.
objectDefIdintThe requested object definition identifier.
anchorCoordWorldTileCoordThe 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
objectInstanceIdintThe created object instance identifier.
objectDefIdintThe placed object definition identifier.
anchorCoordWorldTileCoordThe logical anchor coordinate targeted by the request.
dirtyFlagsAppliedChunkDirtyFlagsThe dirty flags applied to affected chunks.
Returns
- ObjectPlacementResult
A successful object-placement result.