extends StateMachine

class_name SubStateMachine

@export var enter_state: State

func enter() -> void:
	change_state(enter_state)

func exit() -> void:
	if is_multiplayer_authority():
		clear_state.rpc()

func update(delta: float) -> void:
	if current_state == null:
		return
	current_state.update(delta)

func physics_update(delta: float) -> void:
	if current_state == null:
		return
	current_state.physics_update(delta)

func _process(_delta: float) -> void:
	pass

func _physics_process(_delta: float) -> void:
	pass

func _input(_event: InputEvent) -> void:
	pass

func state_input(event: InputEvent) -> void:
	if current_state != null:
		current_state.state_input(event)
