juste better

This commit is contained in:
2025-04-02 10:54:14 +02:00
parent 1b9ff5bdd1
commit 97cafb903a
12 changed files with 212 additions and 131 deletions

View File

@@ -4,12 +4,12 @@ import chess.model.Game;
public class CommandExecutor {
private final Game game;
private final OutputSystem outputSystem;
private Game game;
private OutputSystem outputSystem;
public CommandExecutor(Game game, OutputSystem outputSystem) {
this.game = game;
this.outputSystem = outputSystem;
public CommandExecutor() {
this.game = null;
this.outputSystem = null;
}
public CommandResult executeCommand(Command command) {
@@ -22,16 +22,14 @@ public class CommandExecutor {
private void alternatePlayers() {
this.game.switchPlayerTurn();
this.outputSystem.playerTurn(this.game.getPlayerTurn());
}
public void setOutputSystem(OutputSystem outputSystem) {
this.outputSystem = outputSystem;
}
public Game getGame() {
return game;
public void setGame(Game game) {
this.game = game;
}
public OutputSystem getOutputSystem() {
return outputSystem;
}
}