Validation Classes

Validation API reference for validation classes in GridBuilding v5-0

Validation Classes

This section contains the API reference for all validation classes in the GridBuilding v5-0 plugin.

CollisionGeometryCalculator

Pure function to check if two polygons intersect

CollisionGeometryUtils

[b]Returns[/b]

  • [code]bool[/code] — [code]true[/code] if the polygon is strictly convex; otherwise [code]false[/code].

CollisionMapper

[b]Guard: Setup Validation[/b] Checks if setup() has been called and logs warnings if incomplete. [b]Returns[/b]: bool – true if setup is complete, false otherwise (logs and prevents continuation).

CollisionObjectResolver

@param collision_obj: The CollisionObject2D to check @param layer_mask: The layer mask to match against @return true if the object matches the layer mask

CollisionPolygonProcessor

@param polygon_node: The CollisionPolygon2D node to process. @param map: The TileMapLayer to map offsets against. @param logger: The logger for diagnostic output. @return A Dictionary[Vector2i, Array[CollisionPolygon2D]] containing tile offsets as keys and associated collision polygons as values.

CollisionProcessor

Merge two collision position dictionaries

CollisionRuleSettings

Whether to show a list of layers tested in output messages

CollisionShapeProcessor

@param target_positions: Dictionary to merge into (modified in-place) @param source_positions: Dictionary to merge from

CollisionTestSetup

Expands the rectangle by shape_stretch_size to ensure comprehensive tile coverage. Handles complex transforms by converting to squares when rotation/skew is present.

CollisionTestSetup2D

Expands the rectangle by shape_stretch_size to ensure comprehensive tile coverage. Handles complex transforms by converting to squares when rotation/skew is present.

CollisionUtilities

Check if a collision object matches the given layer mask

CollisionsCheckRule

Returns an array of issues found during runtime validation

IndicatorCollisionTestSetup

Expands the rectangle by shape_stretch_size to ensure comprehensive tile coverage. Handles complex transforms by converting to squares when rotation/skew is present.

RectCollisionTestingSetup

Sets up area_2d and collision_shape

RuleCheckIndicator

Helpers to read debug tuning values from GBDebugSettings (if available).

RuleCheckIndicatorLogic

Pick the appropriate display settings given validity state and failing rules.

RuleFilters

Filters build rules to get all collision rules from an array of building rules.[br][br] [code]p_building_rules[/code]: [i]Array[PlacementRule][/i] - Array of placement rules to filter

RuleResult

Convenience accessor returning all issues (alias)

RuleValidationLogic

Pure logic class for rule validation operations. Contains no state and can be easily tested in isolation.

SpendMaterialsRuleGeneric

Finds the container for the spendable materials by searching either for the matching node by name or class name Starts at the user node of the building system and then checks children nodes recursively

TileCheckRule

Returns an array of issues found during runtime validation

ValidationResults

Generates a concise summary string of the validation results.

WithinTilemapBoundsRule

Emits gated diagnostics when debug diagnostics are enabled