extends "res://Systems/StateMachine/ChessGameState.gd" var moveTimer: Timer func _ready() -> void: moveTimer = Timer.new() moveTimer.one_shot = true # Timer only fires once moveTimer.connect("timeout", _on_move_timer_timeout) add_child(moveTimer) func enter(_previous: String, _data := {}) -> void: print("ENTERING STATE ", Constants.BLACK_TURN) game.currentPlayer = game.BLACK # Delay to avoid duplication during animation if game.stockfishController: moveTimer.start(2) func _on_move_timer_timeout() -> void: # Generate AI move after delay print("------------------GENERATING MOVE --------------------") if game.stockfishController: print("------------------STARTING GENERATING MOVE --------------------") game.stockfishController.generateMove(1000) # 1 second think time finished.emit(Constants.HAND_SETUP) func exit() -> void: moveTimer.stop()