Interface IPlacementRule
- Namespace
- MoonBark.GridPlacement.Core.Interfaces
- Assembly
- MoonBark.GridPlacement.Core.dll
Interface for placement rules, enabling POCS testing of validation logic without Godot dependencies.
In Godot, this maps to PlacementRule (extends Resource). In C# tests, we can use MockPlacementRule.
public interface IPlacementRule
Properties
Id
Unique identifier for the rule.
string Id { get; }
Property Value
Name
Human-readable name for the rule.
string Name { get; }
Property Value
Methods
Validate(IGridConfiguration, CoreVector2I, PlacementData?)
Validates the placement against this rule.
ValidationResult Validate(IGridConfiguration configuration, CoreVector2I gridPosition, PlacementData? placementData)
Parameters
configurationIGridConfigurationThe grid configuration.
gridPositionCoreVector2IThe grid position to validate.
placementDataPlacementDataThe data of the item being placed.
Returns
- ValidationResult
A ValidationResult indicating success or failure.