Table of Contents

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

string

Name

Human-readable name for the rule.

string Name { get; }

Property Value

string

Methods

Validate(IGridConfiguration, CoreVector2I, PlacementData?)

Validates the placement against this rule.

ValidationResult Validate(IGridConfiguration configuration, CoreVector2I gridPosition, PlacementData? placementData)

Parameters

configuration IGridConfiguration

The grid configuration.

gridPosition CoreVector2I

The grid position to validate.

placementData PlacementData

The data of the item being placed.

Returns

ValidationResult

A ValidationResult indicating success or failure.