refactor OutputSystem
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package chess.controller.commands;
|
||||
|
||||
import chess.controller.OutputSystem;
|
||||
import chess.controller.PlayerCommand;
|
||||
import chess.controller.event.GameListener;
|
||||
import chess.model.ChessBoard;
|
||||
import chess.model.Coordinate;
|
||||
import chess.model.Game;
|
||||
@@ -24,7 +24,7 @@ public class MoveCommand extends PlayerCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandResult execute(Game game, OutputSystem outputSystem) {
|
||||
public CommandResult execute(Game game, GameListener outputSystem) {
|
||||
final ChessBoard board = game.getBoard();
|
||||
|
||||
// we must promote the pending pawn before
|
||||
@@ -58,7 +58,7 @@ public class MoveCommand extends PlayerCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CommandResult undoImpl(Game game, OutputSystem outputSystem) {
|
||||
protected CommandResult undoImpl(Game game, GameListener outputSystem) {
|
||||
final ChessBoard board = game.getBoard();
|
||||
|
||||
board.undoMove(move, deadPiece);
|
||||
@@ -66,11 +66,11 @@ public class MoveCommand extends PlayerCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postExec(Game game, OutputSystem outputSystem) {
|
||||
public void postExec(Game game, GameListener outputSystem) {
|
||||
tryPromote(game, outputSystem);
|
||||
}
|
||||
|
||||
private void tryPromote(Game game, OutputSystem outputSystem) {
|
||||
private void tryPromote(Game game, GameListener outputSystem) {
|
||||
Coordinate pawnPos = game.getBoard().pawnPromotePosition();
|
||||
|
||||
if (pawnPos == null)
|
||||
|
||||
Reference in New Issue
Block a user