IPlacementService

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

This page documents the supported public API surface only. Private, internal, benchmark, test, and implementation-detail types are intentionally omitted.

Declaration

1
public interface IPlacementService

Summary

Enhanced placement service interface for agnostic object placement.

This service handles placement, removal, and movement of any placeable objects (buildings, pickups, items, etc.) without Godot dependencies. It provides clean separation between core placement algorithms and engine-specific presentation.

Responsibilities:

  • Validate placement rules and constraints
  • Execute placement operations (business logic only)
  • Manage object removal and movement
  • Handle agnostic object types (buildings, pickups, items)
  • Provide placement diagnostics and reporting

Non-Responsibilities:

  • Scene instantiation or node management (handled by ISceneService)
  • Visual indicators or UI feedback (handled by IIndicatorService)
  • Object health/damage management (out of scope for placement)
  • Godot-specific operations or engine integration

Owner Resolution: The placer/owner can be resolved from the service’s OwnerContext rather than being passed explicitly. Pass null to use the context’s current owner.

Metadata

Namespace: GridPlacement.Core.Services.Placement

Source File: cs/Core/Services/Placement/IPlacementService.cs

Assembly: GridPlacement.Core

Type: interface

Properties

IsReady

1
public abstract bool IsReady { get; }

Gets whether the placement service is ready for operations.


Methods

ValidateSnapshot

1
2
3
4
5
PlacementReport ValidateSnapshot(
    Placeable placeable,
    GridPlacement.Core.Types.TargetingSnapshot2D snapshot,
    int rotation
)

Validates placement of a placeable at a specific position.

Parameters

NameDescription
placeableThe placeable to validate
snapshotThe targeting snapshot containing position data
rotationThe rotation of the placeable (0-3)

Returns

Placement validation report with detailed results


ComputePreviewModel

1
2
3
4
5
PreviewModel ComputePreviewModel(
    Placeable placeable,
    GridPlacement.Core.Types.TargetingSnapshot2D snapshot,
    int rotation
)

Computes the preview model for a placeable at a specific position.

Parameters

NameDescription
placeableThe placeable to preview
snapshotThe targeting snapshot containing position data
rotationThe rotation of the placeable (0-3)

Returns

A preview model with transform and occupied cells


ExecutePlacement

1
2
3
4
5
PlacementResult ExecutePlacement(
    Placeable placeable,
    CoreVector2 position,
    IOwner? placer = null
)

Executes placement of a placeable at a specific position. Note: This only handles the business logic. Actual scene instantiation should be handled by ISceneService in the Godot layer.

Parameters

NameDescription
placeableThe placeable to place
positionTarget position for placement
placerEntity performing the placement (or null to use context owner)

Returns

Placement execution result with outcome details


RemoveObject

1
2
3
4
bool RemoveObject(
    CoreVector2 position,
    IOwner? remover = null
)

Removes a placed object from the specified position.

Parameters

NameDescription
positionPosition of the object to remove
removerEntity performing the removal (or null to use context owner)

Returns

True if removal was successful


MoveObject

1
2
3
4
5
bool MoveObject(
    CoreVector2 fromPosition,
    CoreVector2 toPosition,
    IOwner? mover = null
)

Moves an object from one position to another.

Parameters

NameDescription
fromPositionCurrent position of the object
toPositionTarget position for movement
moverEntity performing the movement (or null to use context owner)

Returns

True if movement was successful


IsPositionOccupied

1
bool IsPositionOccupied(CoreVector2 position)

Checks if a position is currently occupied.

Parameters

NameDescription
positionPosition to check

Returns

True if position is occupied


GetObjectsInArea

1
IEnumerable<Placeable> GetObjectsInArea(CoreRect2I area)

Gets all placed objects within a specified area.

Parameters

NameDescription
areaArea to search within

Returns

Collection of placed objects in the area


GetObjectsByOwner

1
IEnumerable<Placeable> GetObjectsByOwner(string ownerId)

Gets all objects owned by a specific entity.

Parameters

NameDescription
ownerIdOwner identifier

Returns

Collection of objects owned by the specified entity


GetValidationIssues

1
IEnumerable<string> GetValidationIssues()

Gets validation issues if any dependencies are missing or misconfigured.

Returns

Collection of validation issue descriptions


ValidateObjectPlacement

1
2
3
4
ValidationResult ValidateObjectPlacement(
    CoreVector2 position,
    string placeableType
)

Validates object placement with detailed error reporting.

Parameters

NameDescription
positionTarget position
placeableTypeType of placeable object

Returns

Validation result containing any issues


Reset

1
void Reset()

Resets the placement service state.


ClearAllObjects

1
void ClearAllObjects()

Clears all placed objects (for testing/reset scenarios).