ValidationResults
Summary
Section titled “Summary”Results from building rule validation tests.
Properties
Section titled “Properties”message: StringSuccess or failure message.
rule_results: Dictionary[PlacementRule, RuleResult] = {}Individual rule results
Methods
Section titled “Methods”func _init( p_is_successful: bool, p_message: String, p_rule_results: Dictionary[PlacementRule, RuleResult] )Setup/configuration errors (developer problems) Fix these issues for your game
Constructor for creating validation results.
p_is_successful: bool - Whether validation passedp_message: String - Success or failure messagep_rule_results: Dictionary[PlacementRule, Array] - Individual rule results including an array of issues for each rule prevent successful placement validationfunc add_rule_result( p_placement_rule: PlacementRule, p_result: RuleResult ) -> voidAdds a rule result for a specific placement rule.
func get_issues( ) -> Array[String]func add_error( p_error: String ) -> voidAdds a configuration/setup error This should be reported to the developer appropriately
func is_successful( ) -> boolChecks that there were no validation issues with the placement of the object
func has_failing_rules( ) -> boolWhether the validation had any failing placement rules
func has_errors( ) -> boolWhether the validation had any development configuration or setup errors These should be reported to the developer
func get_successful_rules( ) -> Array[PlacementRule]Gets the successful rules
func get_failing_rules( ) -> Array[PlacementRule]Gets the failing rules
func get_errors( ) -> Array[String]Gets the configuration/setup errors in a duplicated array
func get_failing_rule_results( ) -> Dictionary[PlacementRule, Array]Gets the failing rules and their issues Array[String]
func get_summary_string( ) -> StringGenerates a concise summary string of the validation results.
Source
Section titled “Source”addons/grid_building/placement/placement_rules/validation_results.gd
This API reference is automatically generated from the plugin source code. For implementation examples and usage guides, see the guides section.