RuleBasedPlacementValidator

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 RuleBasedPlacementValidator : IPlacementValidator

Summary

Placement validator that evaluates a set of IPlacementRule instances.

Metadata

Namespace: GridPlacement.Core.Validation

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

Assembly: GridPlacement.Core

Type: class

Implements

  • IPlacementValidator

Constructors

RuleBasedPlacementValidator

1
2
3
4
public RuleBasedPlacementValidator(
    List<IPlacementRule> rules,
    IConfigurationProvider<ValidationConfiguration>? configProvider = null
)

Initializes a new instance of the RuleBasedPlacementValidator class.

Parameters

NameDescription
rulesThe rules to apply when validating placement.
configProviderOptional configuration provider for validation settings.

Methods

ValidatePlacement

1
2
3
4
5
public bool ValidatePlacement(
    float x,
    float y,
    string placeableId
)

Validates a placement request.

Parameters

NameDescription
xThe X coordinate.
yThe Y coordinate.
placeableIdThe placeable identifier.

Returns

true if placement is valid; otherwise false.


ValidatePlacement

1
2
3
4
5
6
public bool ValidatePlacement(
    float x,
    float y,
    string placeableId,
    Dictionary<string, object> context
)

Validates a placement request with an additional context payload.

Parameters

NameDescription
xThe X coordinate.
yThe Y coordinate.
placeableIdThe placeable identifier.
contextAdditional validation context.

Returns

true if placement is valid; otherwise false.


GetValidationResult

1
2
3
4
5
public ValidationResult GetValidationResult(
    float x,
    float y,
    string placeableId
)

Gets a validation result containing any errors and warnings for the placement request.

Parameters

NameDescription
xThe X coordinate.
yThe Y coordinate.
placeableIdThe placeable identifier.

Returns

The validation result.


IsPlacementAllowed

1
2
3
4
5
public bool IsPlacementAllowed(
    float x,
    float y,
    string placeableId
)

Returns whether placement is allowed for the given request.

Parameters

NameDescription
xThe X coordinate.
yThe Y coordinate.
placeableIdThe placeable identifier.

Returns

true if placement is allowed; otherwise false.