RuleResult

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

Results from placement rule validation.

Source File: addons/grid_building/placement/placement_rules/rule_result.gd

Extends: RefCounted

Properties

  • Property: rule: [PlacementRule](./placement-rule/) - The rule that was tested.
  • Property: issues: Array[String] = [] - Issues found during validation.

Public Methods

build

1
2
3
4
build(
    p_rule: PlacementRule,
    p_issues: Array[String]
) -> RuleResult

Flags: static

Factory for creating a finished rule result. Creates an immutable result with all validation data complete. p_rule The rule that was tested p_issues Issues found during validation p_reason Reason for success or failure


add_issue

1
add_issue(p_issue: String) -> void

Adds a single validation issue to the result. p_issue A descriptive validation issue. Should not be empty.


add_issues

1
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.


is_successful

1
is_successful() -> bool

Returns whether the rule validation was successful. A rule is considered successful if no validation issues were found.


is_empty

1
is_empty() -> bool

Backward compatibility shim expected by legacy validation code which called is_empty on RuleResult


get_issues

1
get_issues() -> Array[String]

Convenience accessor returning all issues (alias)


Private Methods

_init

1
_init(p_rule: PlacementRule) -> void

Flags: private

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.