mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
Fixed (probably) the player1 concedes but other player2 wins. Fixed that if player runs out of timer time or player lose of beeing idle, the match will end correctly.
This commit is contained in:
parent
6d039e4262
commit
473c9e207b
32 changed files with 286 additions and 132 deletions
|
|
@ -60,11 +60,13 @@ public class ActionSimulator {
|
|||
|
||||
public int evaluateState() {
|
||||
Player opponent = game.getPlayer(game.getOpponents(player.getId()).iterator().next());
|
||||
if (game.isGameOver()) {
|
||||
if (player.hasLost() || opponent.hasWon())
|
||||
if (game.gameOver(null)) {
|
||||
if (player.hasLost() || opponent.hasWon()) {
|
||||
return Integer.MIN_VALUE;
|
||||
if (opponent.hasLost() || player.hasWon())
|
||||
}
|
||||
if (opponent.hasLost() || player.hasWon()) {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
}
|
||||
int value = player.getLife();
|
||||
value -= opponent.getLife();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue