25 lines
512 B
Java
25 lines
512 B
Java
package chess.controller.commands;
|
|
|
|
import java.util.List;
|
|
|
|
import chess.controller.Command;
|
|
import chess.controller.event.GameListener;
|
|
import chess.model.Game;
|
|
import chess.model.Move;
|
|
|
|
public class GetPlayerMovesCommand extends Command {
|
|
|
|
private List<Move> moves;
|
|
|
|
@Override
|
|
public CommandResult execute(Game game, GameListener outputSystem) {
|
|
this.moves = game.getBoard().getAllowedMoves(game.getPlayerTurn());
|
|
return CommandResult.NotMoved;
|
|
}
|
|
|
|
public List<Move> getMoves() {
|
|
return moves;
|
|
}
|
|
|
|
}
|