fix build
This commit is contained in:
@@ -6,11 +6,11 @@ import chess.controller.OutputSystem;
|
||||
import chess.controller.commands.GetPieceAtCommand;
|
||||
import chess.controller.commands.MoveCommand;
|
||||
import chess.controller.commands.PromoteCommand;
|
||||
import chess.controller.commands.SurrenderCommand;
|
||||
import chess.model.Color;
|
||||
import chess.model.Coordinate;
|
||||
import chess.model.Move;
|
||||
import chess.model.Piece;
|
||||
import chess.model.pieces.*;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
@@ -46,12 +46,17 @@ public class Console implements OutputSystem {
|
||||
Coordinate start = stringToCoordinate(scanner.nextLine());
|
||||
System.out.println("New position: ");
|
||||
Coordinate end = stringToCoordinate(scanner.nextLine());
|
||||
return (this.commandExecutor.executeCommand(new MoveCommand(new Move(start, end))) == Command.CommandResult.Moved;
|
||||
return this.commandExecutor.executeCommand(new MoveCommand(new Move(start, end))) == Command.CommandResult.Moved;
|
||||
}
|
||||
|
||||
public boolean playerPickedSurrender(Color player) {
|
||||
this.commandExecutor.executeCommand(new SurrenderCommand(player));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void playerTurn(Color color) {
|
||||
updateDisplay();
|
||||
System.out.println(Colors.RED + "Player turn: " + color + Colors.RESET);
|
||||
boolean endTurn = false;
|
||||
do {
|
||||
@@ -64,7 +69,7 @@ public class Console implements OutputSystem {
|
||||
endTurn = switch (scanner.nextLine()) {
|
||||
case "1" -> playerPickedMove();
|
||||
case "2" -> playerPickedShowMoves();
|
||||
case "3" -> playerPickedSurrender();
|
||||
case "3" -> playerPickedSurrender(color);
|
||||
default -> false;
|
||||
};
|
||||
} while (!endTurn);
|
||||
@@ -106,7 +111,6 @@ public class Console implements OutputSystem {
|
||||
@Override
|
||||
public void gameStarted() {
|
||||
System.out.println("Game start:");
|
||||
updateDisplay();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user