RuleResult
Summary
Section titled “Summary”Results from placement rule validation.
RuleResult encapsulates the outcome of evaluating a placement rule, storing validation issues, success state, and contextual information for debugging and logging. The class supports both incremental construction (for building issues during validation) and complete construction (for finished results). Success is determined by the absence of validation issues, making the result self-documenting and suitable for build logs and user feedback systems.
Properties
Section titled “Properties”rule: PlacementRule
The rule that was tested.
issues: Array[String] = []
Issues found during validation.
Methods
Section titled “Methods”func _init( p_rule: PlacementRule ) -> void
Creates a basic rule result for incremental building during validation. Use this when you need to build up issues gradually during rule evaluation.
p_rule
: The placement rule being tested. Cannot be null.static func build( p_rule: PlacementRule, p_issues: Array[String] ) -> RuleResult
Factory for creating a finished rule result. Creates an immutable result with all validation data complete.
p_rule
: The rule that was testedp_issues
: Issues found during validationp_reason
: Reason for success or failurefunc add_issue( p_issue: String ) -> void
Adds a single validation issue to the result.
p_issue
: A descriptive validation issue. Should not be empty.func add_issues( p_issues: Array[String] ) -> void
Adds multiple validation issues to the result.
p_issues
: Array of descriptive validation issues. Should not be null.func is_successful( ) -> bool
Returns whether the rule validation was successful. A rule is considered successful if no validation issues were found.
func is_empty( ) -> bool
Backward compatibility shim expected by legacy validation code which called is_empty on RuleResult
func get_issues( ) -> Array[String]
Convenience accessor returning all issues (alias)
Source
Section titled “Source”addons/grid_building/placement/placement_rules/rule_result.gd
This API reference is automatically generated from the plugin source code. For implementation examples and usage guides, see the guides section.