feat: add audio
This commit is contained in:
@@ -75,13 +75,13 @@ public class MoveCommand extends PlayerCommand {
|
||||
}
|
||||
|
||||
if (tryPromote(game, outputSystem)) {
|
||||
outputSystem.onMove(this.move);
|
||||
outputSystem.onMove(this.move, this.deadPiece != null);
|
||||
return CommandResult.ActionNeeded;
|
||||
}
|
||||
|
||||
board.setLastMove(this.move);
|
||||
|
||||
outputSystem.onMove(this.move);
|
||||
outputSystem.onMove(this.move, this.deadPiece != null);
|
||||
|
||||
return CommandResult.Moved;
|
||||
}
|
||||
|
||||
@@ -81,8 +81,8 @@ public class AsyncGameDispatcher extends GameDispatcher {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMove(Move move) {
|
||||
asyncForEachCall((l) -> l.onMove(move));
|
||||
public void onMove(Move move, boolean captured) {
|
||||
asyncForEachCall((l) -> l.onMove(move, captured));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -32,7 +32,7 @@ public class EmptyGameDispatcher extends GameDispatcher {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMove(Move move) {
|
||||
public void onMove(Move move, boolean captured) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,7 +38,7 @@ public abstract class GameAdaptator implements GameListener {
|
||||
public void onGameEnd() {}
|
||||
|
||||
@Override
|
||||
public void onMove(Move move) {}
|
||||
public void onMove(Move move, boolean captured) {}
|
||||
|
||||
@Override
|
||||
public void onMoveNotAllowed(Move move) {}
|
||||
|
||||
@@ -41,8 +41,9 @@ public interface GameListener {
|
||||
* Invoked when a valid move on the board occurs
|
||||
*
|
||||
* @param move the move to be processed
|
||||
* @param captured whether the move is a result of a capture
|
||||
*/
|
||||
void onMove(Move move);
|
||||
void onMove(Move move, boolean captured);
|
||||
|
||||
/**
|
||||
* Invoked when a sent move is not allowed
|
||||
|
||||
Reference in New Issue
Block a user