very basic pgn export
This commit is contained in:
@@ -17,8 +17,12 @@ public class CommandExecutor {
|
||||
}
|
||||
|
||||
public CommandExecutor(Game game) {
|
||||
this(game, new GameDispatcher());
|
||||
}
|
||||
|
||||
public CommandExecutor(Game game, GameDispatcher dispatcher) {
|
||||
this.game = game;
|
||||
this.dispatcher = new GameDispatcher();
|
||||
this.dispatcher = dispatcher;
|
||||
}
|
||||
|
||||
public synchronized CommandResult executeCommand(Command command) {
|
||||
|
||||
@@ -23,6 +23,10 @@ public class MoveCommand extends PlayerCommand {
|
||||
return move;
|
||||
}
|
||||
|
||||
public Piece getDeadPiece() {
|
||||
return deadPiece;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandResult execute(Game game, GameListener outputSystem) {
|
||||
CommandResult result = processMove(game, outputSystem);
|
||||
@@ -98,5 +102,4 @@ public class MoveCommand extends PlayerCommand {
|
||||
outputSystem.onPromotePawn(pawnPos);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package chess.controller.event;
|
||||
|
||||
import chess.model.Color;
|
||||
import chess.model.Coordinate;
|
||||
import chess.model.Move;
|
||||
|
||||
public class EmptyGameDispatcher extends GameDispatcher {
|
||||
|
||||
@Override
|
||||
public void onBoardUpdate() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDraw() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGameEnd() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGameStart() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKingInCheck() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKingInMat() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMove(Move move) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMoveNotAllowed(Move move) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPatSituation() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerTurn(Color color) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPromotePawn(Coordinate pieceCoords) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSurrender(Color coward) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWin(Color winner) {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user