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
placeablePlaceableThe placeable to validate.
Returns
GetWarnings(Placeable?)
Gets validation warnings for a placeable.
public static List<string> GetWarnings(Placeable? placeable)
Parameters
placeablePlaceableThe placeable to validate.
Returns
IsValid(Placeable?)
Checks if a placeable is valid using default rules.
public static bool IsValid(Placeable? placeable)
Parameters
placeablePlaceableThe 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
placeablePlaceableThe 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
placeablePlaceableThe placeable to validate.
rulesPlaceableValidationRule[]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
placeablesIEnumerable<Placeable>The placeables to validate.
Returns
- Dictionary<string, PlaceableValidationResult>
Dictionary mapping placeable IDs to validation results.