ManipulationStateMachine
ManipulationStateMachine
Core state machine for managing manipulation modes. Uses string-based mode identifiers instead of concrete state classes, following composition over inheritance pattern for AOT compatibility. This is the pure C# implementation - the Godot layer wraps this with Node-based states if needed.
Project: GridPlacement v6.0
Layer: Core
Source: Core/State/Manipulation/ManipulationStateMachine.cs
Namespace: GridBuilding.Core.State.Manipulation
Kind: class
Parsing Method: AST-based (Roslyn) - NOT regex
⚠️ IMPORTANT: This documentation was generated using AST parsing, not regex.
Properties
CurrentMode
Current manipulation mode
IsIdle
Whether the state machine is in idle mode
EnableHistory
Whether state history tracking is enabled
MaxHistorySize
Maximum history size
HasHistory
Whether the state machine has mode history
ModeDuration
Time spent in current mode (seconds)
CurrentData
Current manipulation data
Methods
Update
Updates the state machine
Returns: void
Parameters:
double delta
TransitionTo
Transitions to a new mode
Returns: bool
Parameters:
string newMode
TransitionToIdle
Transitions to idle mode
Returns: bool
RevertToPrevious
Reverts to the previous mode
Returns: bool
CanTransitionTo
Checks if a transition to the target mode is allowed
Returns: bool
Parameters:
string targetMode
ConfigureTransitions
Configures allowed transitions from a source mode
Returns: void
Parameters:
string fromModestring[] toModes
RegisterMode
Registers a custom mode
Returns: void
Parameters:
string modeName
GetModeHistory
Gets the mode history
Returns: List<string>
TryStartBuilding
Attempts to start building at the specified position
Returns: bool
Parameters:
CoreVector2I worldPosition
ClearHistory
Clears the mode history
Returns: void
Reset
Resets the state machine to idle
Returns: void