This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## A state machine that manages state transitions and executes callbacks. | |
| class_name StateMachine | |
| ## The currently active state. | |
| var current_state: State | |
| ## Sets the initial state and calls its enter callback. | |
| ## Should be called once during initialization (e.g., in _ready()). | |
| func set_initial_state(state: State): | |
| _set_state(state) |