PlacementService2D
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
Minimal concrete implementation of IPlacementService for core TDD.
This version keeps an in-memory map of placed objects keyed by world position. It is intentionally simple and engine-agnostic, suitable for unit testing.
OBSOLETE: This service is replaced by modern ECS placement systems. Use PlacementSystem and related ECS systems for new development.
Metadata
Namespace: GridPlacement.Core.Services.Placement
Source File: cs/Core/Services/Placement/PlacementService2D.cs
Assembly: GridPlacement.Core
Type: class
Implements
IPlacementServiceIService
Constructors
PlacementService2D
Initializes a new instance of the PlacementService2D class with a default state.
Parameters
| Name | Description |
|---|---|
eventBus | The event bus to publish events to. |
configProvider | The configuration provider for placement settings. |
Properties
IsReady
Gets a value indicating whether the service is ready to accept placement requests.
Methods
GetSnapshot
ValidatePlacement
Validates a placement request at the given position.
Parameters
| Name | Description |
|---|---|
placeable | The placeable definition to place. |
position | The world position to place at. |
placer | Optional owner context for the placer. |
Returns
A report describing whether the placement is valid and any issues found.
ValidateSnapshot
ComputePreviewModel
ExecutePlacement
Executes a placement request at the given position.
Parameters
| Name | Description |
|---|---|
placeable | The placeable definition to place. |
position | The world position to place at. |
placer | Optional owner context for the placer. |
Returns
The result of attempting to place the object.
RemoveObject
Removes any object at the given position.
Parameters
| Name | Description |
|---|---|
position | The position to remove from. |
remover | Optional owner context for the remover. |
Returns
true if an object was removed; otherwise false.
MoveObject
Moves an object from one position to another.
Parameters
| Name | Description |
|---|---|
fromPosition | The source position. |
toPosition | The destination position. |
mover | Optional owner context for the mover. |
Returns
true if the object was moved; otherwise false.
IsPositionOccupied
Determines whether the given position is occupied by an object.
Parameters
| Name | Description |
|---|---|
position | The position to check. |
Returns
true if the position is occupied; otherwise false.
GetObjectsInArea
Enumerates all placed objects within the given area.
Parameters
| Name | Description |
|---|---|
area | The area to search for objects. |
Returns
An enumeration of placeables within the given area.
GetObjectsByOwner
Enumerates all placed objects associated with the given owner key.
Parameters
| Name | Description |
|---|---|
ownerKey | The owner key used to filter objects. |
Returns
An enumeration of placeables that match the given owner key.
GetValidationIssues
Returns any global validation issues for the service.
Returns
An enumeration of validation issue messages.
ValidateObjectPlacement
Validates that a given placeable type could be placed at the specified position.
Parameters
| Name | Description |
|---|---|
position | The position to validate. |
placeableType | The placeable type identifier. |
Returns
A validation result with any errors found.
Reset
Clears all in-memory state held by this service.
ClearAllObjects
Removes all placed objects.