Skip to content

Class

PlacementTelemetry

Generated GDScript class reference for GridPlacement.PlacementTelemetry.

Status
Draft
Version
v6.0
Updated
Development docs generated from GDScript source

This is unreleased documentation in active development. APIs, class names, and behavior may change before the final release.

Read-only telemetry surface for placement/manipulation state. Centralizes "how do I read placement state for a test assertion?" into one place so tests and diagnostics do not reach into private fields or re-derive map math. Each reader returns an immutable snapshot struct; tests assert against the snapshot fields. The readers are null-safe: pass whatever you have (session and/or host) and the snapshot fields default to "empty" values when the underlying state is missing — so a test can distinguish "no manipulation active" from "rotation is zero" by checking [member ManipulationSnapshot.is_active]. Usage: [codeblock] var snap := PlacementTelemetry.read_manipulation(session) assert_int(snap.cardinal).is_equal(PlacementGridRotationUtils.CardinalDirection.EAST) var action := PlacementTelemetry.read_placement_action(session) assert_bool(action.last_report_success).is_true() [/codeblock] Regressions in placement state used to slip through because tests could not easily observe it. This class closes that gap.

Source: addons/grid_placement/telemetry/placement_telemetry.gd

Syntax

class PlacementTelemetry extends RefCounted

Members

NameKindSummary
DETAIL_NAMESFieldDetail controls evidence production independently from PlacementLogger severity. SUMMARY is the default useful terminal signal; TRACE remains opt-in.
levelProperty
allowsMethod
set_from_debug_settingsMethod
set_levelMethod
MAX_RECORDSField
policyProperty
recordMethod
record_previewMethod
record_decisionMethod
normalizedProperty
signatureProperty
record_dispatchMethod
preview_countMethod
recordsMethod
latestMethod
latest_jsonMethod
clearMethod
snapshot_previewMethod
snapshotProperty
snapshot_decisionMethod
snapshotProperty
snapshot_dispatchMethod
is_activePropertySnapshot of the active manipulation transform (rotation, flip, target). Read via [method read_manipulation]. True when a [ManipulationParent] is wired and a target is under manipulation.
rotation_degreesPropertyLogical rotation in degrees (sprite-swap aware). 0.0 when inactive.
cardinalPropertyNearest cardinal facing derived from [member rotation_degrees].
flipped_horizontallyPropertyHorizontal mirror state (negative scale.x).
flipped_verticallyPropertyVertical mirror state (negative scale.y).
active_targetPropertyThe root node being manipulated, or null.
to_dictionaryMethod
modePropertySnapshot of placement/build state for the current selection + last action. Read via [method read_placement_action]. Current placement mode (OFF/INFO/MOVE/DEMOLISH/PLACE).
has_placeablePropertyTrue when a placeable is selected for building.
selected_placeable_idPropertyThe selected placeable's id, or an empty StringName.
has_terrainPropertyTrue when a terrain is selected for painting.
selected_terrain_namePropertyThe selected terrain's name, or an empty StringName.
has_previewPropertyTrue when a placement preview instance currently exists.
last_dispatchPropertyThe last host dispatch result, or null when no action has dispatched. This is the canonical "what just happened" surface — same object the host tests assert against via [method GridPlacementHost.get_last_dispatch_result].
last_action_successPropertyConvenience: True when [member last_dispatch] exists and reports success.
last_action_issuesPropertyConvenience: issues from [member last_dispatch], empty when no dispatch.
to_dictionaryMethod
modePropertySnapshot of targeting/positioner state (current cell, map, manual targeting). Read via [method read_targeting]. Current placement mode.
positioner_cellPropertyThe 2D cell under the positioner, or [constant Vector2i.ZERO] when unresolved.
positioner_cell_3dPropertyThe 3D cell under the positioner, or [constant Vector3i.ZERO] when unresolved.
has_target_mapPropertyTrue when a 2D target map is wired.
has_target_map_3dPropertyTrue when a 3D target map is wired. Lets tests distinguish "3D unwired" from "wired but resolving ZERO" without touching state.
is_manual_targetingPropertyTrue while a build preview / move copy is driving manual targeting.
to_dictionaryMethod
read_manipulationMethod
read_placement_actionMethod
read_targetingMethod