ChessBuilder/Systems/StateMachine/GameStates/CleanupPhase.gd

12 lines
No EOL
393 B
GDScript

extends "res://Systems/StateMachine/ChessGameState.gd"
func enter(_previous: String, data := {}) -> void:
print("ENTERING STATE ", Constants.CLEANUP)
game.endTurn()
if "endCondition" in data:
finished.emit(Constants.ROUND_END)
elif game.currentPlayer == game.WHITE:
finished.emit(Constants.BLACK_TURN)
else:
finished.emit(Constants.WHITE_TURN)