Reference
Construction
Tickets and results for the experimental construction bridge.
Usage context
| Module | Package | SDK source |
|---|---|---|
| Kotlin/JVM | fr.nimby.sdk | kotlin-client/src/main/kotlin/fr/nimby/sdk/Construction.kt |
Public API for SDK 0.9.0-alpha.2. Each entry provides the Kotlin signature and its contract: what the value means, conditions of use and effects to understand. Choose imports from the module shown above.
import fr.nimby.sdk.ConstructionResult
import fr.nimby.sdk.ConstructionStateConstructionResult
data class ConstructionResult(
val state: ConstructionState, val token: Long, val createdIds: List<Long>,
val reason: Int, val canUndo: Boolean,
)Result of an experimental construction operation. Retain the ticket to track PENDING or an uncertain response; never repeat creation to wait for completion.
ConstructionResult.state
val state: ConstructionStateCurrent operation state, to handle explicitly.
ConstructionResult.token
val token: LongOpaque ticket associated with the game/editing session. Retain it before writing and do not reuse it after a game change.
ConstructionResult.createdIds
val createdIds: List<Long>Identities of signals actually reported as created; retain them for partial results too.
ConstructionResult.reason
val reason: IntRefusal/result code to retain in logs with ticket and state; do not infer success from this code alone.
ConstructionResult.canUndo
val canUndo: BooleanUndo availability at result time; an intervening command can invalidate it.
ConstructionState
enum class ConstructionState {
READY,
APPLIED,
UNDONE,
REJECTED,
PARTIAL,
PENDING
}Distinct operation stages and outcomes. Pending or partial states must not be treated as complete success.
ConstructionState.READY
READYPreparation accepted; no signal added by that preparation.
ConstructionState.APPLIED
APPLIEDCreation applied; read createdIds and canUndo.
ConstructionState.UNDONE
UNDONEUndo applied.
ConstructionState.REJECTED
REJECTEDOperation refused; read reason and game state before another request.
ConstructionState.PARTIAL
PARTIALPartial result; retain returned identities and inspect the situation without resending the full batch.
ConstructionState.PENDING
PENDINGOperation still pending; inspect its ticket with poll.