PlacementState

PlacementState

In-memory placement state for core, engine-agnostic placement services.

Project: GridPlacement v6.0
Layer: Godot
Source: Godot/Core/State/Placement/PlacementState.cs
Namespace: GridBuilding.Core.State.Placement
Kind: class

Parsing Method: AST-based (Roslyn) - NOT regex

⚠️ IMPORTANT: This documentation was generated using AST parsing, not regex.

Properties

Revision

Gets a monotonically increasing revision number that changes whenever the state mutates.

IsInitialized

Gets a value indicating whether the state has been initialized.

IsReady

Gets a value indicating whether the state is ready for use.

HasError

Gets a value indicating whether the state is currently in an error condition.

LastError

Gets the last error message, if any.

Methods

IsPositionOccupied

Determines whether the given position is occupied.

Returns: bool

Parameters:

  • CoreVector2 position

TryAdd

Attempts to add a new placed object to the state.

Returns: bool

Parameters:

  • CoreVector2 position
  • Placeable placeable
  • string ownerKey
  • string? error

Remove

Removes any placed object at the given position.

Returns: bool

Parameters:

  • CoreVector2 position

TryMove

Attempts to move a placed object from one position to another.

Returns: bool

Parameters:

  • CoreVector2 fromPosition
  • CoreVector2 toPosition

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

ClearAllObjects

Clears all placed objects from the state.

Returns: void