Table of Contents

Class PlaceableValidator

Namespace
MoonBark.GridPlacement.Core.Catalog
Assembly
MoonBark.GridPlacement.Core.dll

Utility class for validating placeable objects. Extracts validation logic from multiple classes into a single utility.

public static class PlaceableValidator
Inheritance
PlaceableValidator
Inherited Members

Methods

GetErrors(Placeable?)

Gets validation errors for a placeable.

public static List<string> GetErrors(Placeable? placeable)

Parameters

placeable Placeable

The placeable to validate.

Returns

List<string>

List of validation errors.

GetWarnings(Placeable?)

Gets validation warnings for a placeable.

public static List<string> GetWarnings(Placeable? placeable)

Parameters

placeable Placeable

The placeable to validate.

Returns

List<string>

List of validation warnings.

IsValid(Placeable?)

Checks if a placeable is valid using default rules.

public static bool IsValid(Placeable? placeable)

Parameters

placeable Placeable

The placeable to check.

Returns

bool

True if the placeable is valid, false otherwise.

Validate(Placeable?)

Validates a placeable using default rules.

public static PlaceableValidationResult Validate(Placeable? placeable)

Parameters

placeable Placeable

The placeable to validate.

Returns

PlaceableValidationResult

Validation result.

Validate(Placeable?, params PlaceableValidationRule[])

Validates a placeable using specific rules.

public static PlaceableValidationResult Validate(Placeable? placeable, params PlaceableValidationRule[] rules)

Parameters

placeable Placeable

The placeable to validate.

rules PlaceableValidationRule[]

The validation rules to apply.

Returns

PlaceableValidationResult

Validation result.

ValidateAll(IEnumerable<Placeable?>)

Validates a collection of placeables.

public static Dictionary<string, PlaceableValidationResult> ValidateAll(IEnumerable<Placeable?> placeables)

Parameters

placeables IEnumerable<Placeable>

The placeables to validate.

Returns

Dictionary<string, PlaceableValidationResult>

Dictionary mapping placeable IDs to validation results.