remove try catch
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
package chess.model;
|
package chess.model;
|
||||||
|
|
||||||
import java.util.EmptyStackException;
|
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
|
|
||||||
import chess.controller.PlayerCommand;
|
import chess.controller.PlayerCommand;
|
||||||
@@ -92,12 +91,9 @@ public class Game {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PlayerCommand getLastAction() {
|
public PlayerCommand getLastAction() {
|
||||||
try {
|
if (this.movesHistory.isEmpty())
|
||||||
PlayerCommand last = this.movesHistory.pop();
|
|
||||||
return last;
|
|
||||||
} catch (EmptyStackException e) {
|
|
||||||
return null;
|
return null;
|
||||||
}
|
return this.movesHistory.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateLastMove() {
|
public void updateLastMove() {
|
||||||
|
|||||||
Reference in New Issue
Block a user