Table of Contents

Namespace MoonBark.GridPlacement.Core.Services.Targeting

Classes

CursorTargetQueryPolicy2D

Default policy for selecting cursor targets from world-space query results.

PathCalculatedEventArgs

Event arguments for path calculation success.

PathCalculationFailedEventArgs

Event arguments for path calculation failure.

TargetingService

Pure domain targeting service - single source of truth for grid targeting. All state is stored in plain C# structs, not ECS components.

DESIGN DECISIONS:

  • Pure domain: All state in plain structs
  • No Godot dependencies: Core layer is engine-agnostic
  • Direct event invocation: No wrapper methods
TargetingStateChangedEventArgs

Event arguments for targeting state changes.

Structs

TargetPositionComponent

Component storing the current target grid position and revision. Pure domain struct - no ECS dependency.

TargetReferencesComponent

Component storing target node references. Pure domain struct - no ECS dependency.

TargetStateComponent

Component storing target state flags. Pure domain struct - no ECS dependency.

TargetingSnapshot

Snapshot of targeting service state for debugging.

Interfaces

ICursorTargetQueryPolicy2D

Defines policy rules for accepting a world-query targeting result as the next cursor grid position.

IGridTargetResolver2D

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.

IGridWorldPositionResolver2D

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

IInputSource

Represents an input source that drives target position updates. Different implementations handle different input devices (mouse, gamepad, touch, AI agents).

ITargetingService

Manages the current target position on the grid, regardless of input source. This service coordinates between multiple input sources and provides a unified target position for placement systems.

ITargetingStateSink

Service-side sink for mutating targeting state from external producers.

Enums

InputSourceType

Defines the type of input source.