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
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
Gets whether the placement service is ready for operations.
Methods
ValidateSnapshot
Validates placement of a placeable at a specific position.
Parameters
| Name | Description |
|---|---|
placeable | The placeable to validate |
snapshot | The targeting snapshot containing position data |
rotation | The rotation of the placeable (0-3) |
Returns
Placement validation report with detailed results
ComputePreviewModel
Computes the preview model for a placeable at a specific position.
Parameters
| Name | Description |
|---|---|
placeable | The placeable to preview |
snapshot | The targeting snapshot containing position data |
rotation | The rotation of the placeable (0-3) |
Returns
A preview model with transform and occupied cells
ExecutePlacement
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
| Name | Description |
|---|---|
placeable | The placeable to place |
position | Target position for placement |
placer | Entity performing the placement (or null to use context owner) |
Returns
Placement execution result with outcome details
RemoveObject
Removes a placed object from the specified position.
Parameters
| Name | Description |
|---|---|
position | Position of the object to remove |
remover | Entity performing the removal (or null to use context owner) |
Returns
True if removal was successful
MoveObject
Moves an object from one position to another.
Parameters
| Name | Description |
|---|---|
fromPosition | Current position of the object |
toPosition | Target position for movement |
mover | Entity performing the movement (or null to use context owner) |
Returns
True if movement was successful
IsPositionOccupied
Checks if a position is currently occupied.
Parameters
| Name | Description |
|---|---|
position | Position to check |
Returns
True if position is occupied
GetObjectsInArea
Gets all placed objects within a specified area.
Parameters
| Name | Description |
|---|---|
area | Area to search within |
Returns
Collection of placed objects in the area
GetObjectsByOwner
Gets all objects owned by a specific entity.
Parameters
| Name | Description |
|---|---|
ownerId | Owner identifier |
Returns
Collection of objects owned by the specified entity
GetValidationIssues
Gets validation issues if any dependencies are missing or misconfigured.
Returns
Collection of validation issue descriptions
ValidateObjectPlacement
Validates object placement with detailed error reporting.
Parameters
| Name | Description |
|---|---|
position | Target position |
placeableType | Type of placeable object |
Returns
Validation result containing any issues
Reset
Resets the placement service state.
ClearAllObjects
Clears all placed objects (for testing/reset scenarios).