Table of Contents

Interface IGridTargetResolver2D

Namespace
MoonBark.GridPlacement.Core.Services.Targeting
Assembly
MoonBark.GridPlacement.Core.dll

Core-friendly abstraction for resolving a grid coordinate from a world-space position. Implementations may be engine-backed (e.g. Godot sensors) or pure math fallbacks.

public interface IGridTargetResolver2D

Methods

TryGetTarget(CoreVector2, out CoreVector2I)

Attempts to resolve a target grid coordinate for the provided world-space position.

bool TryGetTarget(CoreVector2 worldPosition, out CoreVector2I gridPosition)

Parameters

worldPosition CoreVector2

World-space position in Core coordinates.

gridPosition CoreVector2I

Resolved grid coordinate when successful.

Returns

bool

True if the target is valid and resolved; otherwise false.