iaaaaaaaaaaaaaa

This commit is contained in:
2025-04-10 12:26:09 +02:00
parent 3226e72d32
commit 17d8333342
5 changed files with 82 additions and 16 deletions

View File

@@ -10,12 +10,12 @@ import chess.model.Coordinate;
import chess.model.Game;
import chess.model.Piece;
public class GetAllowedMovesCommand extends Command {
public class GetAllowedMovesPieceCommand extends Command {
private final Coordinate start;
private List<Coordinate> destinations;
public GetAllowedMovesCommand(Coordinate start) {
public GetAllowedMovesPieceCommand(Coordinate start) {
this.start = start;
this.destinations = new ArrayList<>();
}

View File

@@ -0,0 +1,24 @@
package chess.controller.commands;
import java.util.List;
import chess.controller.Command;
import chess.controller.OutputSystem;
import chess.model.Game;
import chess.model.Move;
public class GetPlayerMovesCommand extends Command {
private List<Move> moves;
@Override
public CommandResult execute(Game game, OutputSystem outputSystem) {
this.moves = game.getBoard().getAllowedMoves(game.getPlayerTurn());
return CommandResult.NotMoved;
}
public List<Move> getMoves() {
return moves;
}
}