lots of things

This commit is contained in:
2025-04-01 23:11:41 +02:00
parent 2c6b64fa7d
commit 1b9ff5bdd1
15 changed files with 428 additions and 79 deletions

View File

@@ -0,0 +1,24 @@
package chess.io.commands;
import chess.io.Command;
import chess.io.CommandResult;
import chess.io.OutputSystem;
import chess.model.Color;
import chess.model.Game;
public class SurrenderCommand extends Command {
private final Color player;
public SurrenderCommand(Color player) {
this.player = player;
}
@Override
public CommandResult execute(Game game, OutputSystem outputSystem) {
outputSystem.hasSurrendered(player);
outputSystem.winnerIs(Color.getEnemy(player));
return CommandResult.NotMoved;
}
}