Skip to content

Class

ObjectSurfaceValidation2D

Generated GDScript class reference for GridPlacement.ObjectSurfaceValidation2D.

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.

Legality of stacking a 2D object onto another object's surface. The decision authority for the SURFACE mount, split from [ObjectSurfaceMountRegistry2D] (which only records who holds each slot) so a registry bookkeeping bug can never authorize a placement. Two rejections, mirroring how 3D TOP reports its failures: [codeblock] SURFACE_OCCUPIED — another object already holds that slot SURFACE_TOO_HIGH — the band sits above the host's declared top surface [/codeblock] Every failure names the cell and slot, because a stacking rejection without coordinates is unactionable: the player cannot tell WHICH surface was full.

Source: addons/grid_placement/systems/building/2d/object_surface_validation_2d.gd

Syntax

class ObjectSurfaceValidation2D extends RefCounted

Members

NameKindSummary
MSG_SURFACE_OCCUPIEDFieldNo host entry offers a surface at the targeted cell. The requested slot is already held by a committed object. The requested band is above the host's declared top surface. The host node is gone or invalid, so its declared surface cannot be trusted. Fails closed rather than inheriting an empty surface. Player-facing message for a rejection reason. Single source of truth so the activity log and the service tag cannot drift apart.
MSG_NO_HOST_SURFACEField
MSG_HOST_UNAVAILABLEField
reasonPropertyVerdict for one candidate surface mount. [member host_entry] is the host's [ScenePlacementEntry] (needed for its declared surface size) and [member host_node] the committed node holding it. One of [enum Reason]. NONE means the mount is legal.
host_nodePropertyThe committed host node, or null when the rejection is about the host.
messagePropertyHuman-readable reason with the offending cell and slot named.
okMethod
offers_surfaceMethod
host_slot_countMethod
max_host_bandMethod
can_place_on_surfaceMethod
verdictProperty
resolvedProperty
host_nodeProperty
host_entryProperty
pairProperty
pairProperty
first_free_mountMethod
bandProperty
top_bandProperty
widthProperty
indexProperty
foundProperty