feat: add audio
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package chess.view.audio;
|
||||
|
||||
import chess.controller.commands.PromoteCommand.PromoteType;
|
||||
import chess.controller.event.GameAdaptator;
|
||||
import chess.model.Move;
|
||||
|
||||
public class GameAudio extends GameAdaptator {
|
||||
|
||||
@@ -28,5 +30,34 @@ public class GameAudio extends GameAdaptator {
|
||||
public void onGameEnd() {
|
||||
playSound("game-end");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMoveNotAllowed(Move move) {
|
||||
playSound("illegal");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMove(Move move, boolean captured) {
|
||||
if (captured) {
|
||||
playSound("capture");
|
||||
return;
|
||||
}
|
||||
playSound("move-self");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKingInCheck() {
|
||||
playSound("move-check");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPawnPromoted(PromoteType promotion) {
|
||||
playSound("promote");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCastling(boolean bigCastling) {
|
||||
playSound("castle");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user