PlacementService2D
PlacementService2D
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.
Project: GridPlacement v6.0
Layer: Godot
Source: Godot/Core/Services/Placement/PlacementService2D.cs
Namespace: GridBuilding.Core.Services.Placement
Kind: class
Parsing Method: AST-based (Roslyn) - NOT regex
⚠️ IMPORTANT: This documentation was generated using AST parsing, not regex.
Properties
State
Gets the current state of the placement service.
IsReady
Gets a value indicating whether the service is ready to accept placement requests.
Methods
ValidatePlacement
Validates a placement request at the given position.
Returns: PlacementReport
Parameters:
Placeable placeableCoreVector2 positionIOwner? placer
ExecutePlacement
Executes a placement request at the given position.
Returns: GridBuilding.Core.Results.PlacementResult
Parameters:
Placeable placeableCoreVector2 positionIOwner? placer
RemoveObject
Removes any object at the given position.
Returns: bool
Parameters:
CoreVector2 positionIOwner? remover
MoveObject
Moves an object from one position to another.
Returns: bool
Parameters:
CoreVector2 fromPositionCoreVector2 toPositionIOwner? mover
IsPositionOccupied
Determines whether the given position is occupied by an object.
Returns: bool
Parameters:
CoreVector2 position
GetObjectsInArea
Enumerates all placed objects within the given area.
Returns: IEnumerable<Placeable>
Parameters:
CoreRect2I area
GetObjectsByOwner
Enumerates all placed objects associated with the given owner key.
Returns: IEnumerable<Placeable>
Parameters:
string ownerKey
GetValidationIssues
Returns any global validation issues for the service.
Returns: IEnumerable<string>
ValidateObjectPlacement
Validates that a given placeable type could be placed at the specified position.
Returns: ValidationResult
Parameters:
CoreVector2 positionstring placeableType
Reset
Clears all in-memory state held by this service.
Returns: void
ClearAllObjects
Removes all placed objects.
Returns: void