RuleResult

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

This page documents the supported public API surface only. Private, internal, benchmark, test, and implementation-detail types are intentionally omitted.

Declaration

1
public class RuleResult

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.

Ported from: godot/addons/grid_building/systems/placement/validators/placement_rules/rule_result.gd

Metadata

Namespace: GridPlacement.Core.Validation

Source File: cs/Core/Validation/RuleResult.cs

Assembly: GridPlacement.Core

Type: class

Constructors

RuleResult

1
public RuleResult(IPlacementRule rule)

Creates a basic rule result for incremental building during validation. Use this when you need to build up issues gradually during rule evaluation.

Parameters

NameDescription
ruleThe placement rule being tested. Cannot be null.

Properties

Rule

1
public IPlacementRule Rule { get; }

The rule that was tested.


IssueCount

1
public int IssueCount { get; }

Returns the count of issues.


Methods

Build

1
2
3
4
public static RuleResult Build(
    IPlacementRule rule,
    IEnumerable<string> issues
)

Factory for creating a finished rule result. Creates an immutable result with all validation data complete.

Parameters

NameDescription
ruleThe rule that was tested
issuesIssues found during validation

AddIssue

1
public void AddIssue(string issue)

Adds a single validation issue to the result.

Parameters

NameDescription
issueA descriptive validation issue. Should not be empty.

AddIssues

1
public void AddIssues(IEnumerable<string> issues)

Adds multiple validation issues to the result.

Parameters

NameDescription
issuesArray of descriptive validation issues.

IsSuccessful

1
public bool IsSuccessful()

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


IsEmpty

1
public bool IsEmpty()

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


GetIssues

1
public List<string> GetIssues()

Returns a copy of all issues.