ValidationResults

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

Results from building rule validation tests.

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

Extends: RefCounted

Properties

  • Property: message : String - Success or failure message.
  • Property: rule_results : Dictionary[PlacementRule, RuleResult] = {} - Individual rule results

Private Properties

  • Property: _errors : Array[String] = [] (private)

    Setup/configuration errors (developer problems) Fix these issues for your game

Public Methods

add_rule_result

1
2
3
4
add_rule_result(
    p_placement_rule : PlacementRule,
    p_result : RuleResult
) -> void

Adds a rule result for a specific placement rule.


get_issues

1
get_issues() -> Array[String]

add_error

1
add_error(p_error : String) -> void

Adds a configuration/setup error This should be reported to the developer appropriately


is_successful

1
is_successful() -> bool

Checks that there were no validation issues with the placement of the object


has_failing_rules

1
has_failing_rules() -> bool

Whether the validation had any failing placement rules


has_errors

1
has_errors() -> bool

Whether the validation had any development configuration or setup errors These should be reported to the developer


get_successful_rules

1
get_successful_rules() -> Array[PlacementRule]

Gets the successful rules


get_failing_rules

1
get_failing_rules() -> Array[PlacementRule]

Gets the failing rules


get_errors

1
get_errors() -> Array[String]

Gets the configuration/setup errors in a duplicated array


get_failing_rule_results

1
get_failing_rule_results() -> Dictionary[PlacementRule, Array]

Gets the failing rules and their issues Array[String]


get_summary_string

1
get_summary_string() -> String

Generates a concise summary string of the validation results.


Private Methods

_init

1
2
3
4
5
_init(
    p_is_successful : bool = false,
    p_message : String = "",
    p_rule_results : Dictionary[PlacementRule, RuleResult] = {}
)

Flags: private

Constructor for creating validation results.

p_is_successful: bool - Whether validation passed

p_message: String - Success or failure message

p_rule_results: Dictionary[PlacementRule, Array] - Individual rule results including an array of issues for each rule prevent successful placement validation