merge fix

This commit is contained in:
Oleg Agafonov 2025-04-19 17:48:27 +04:00
parent 3b421de2e3
commit f83c2bea4b
2 changed files with 3 additions and 2 deletions

View file

@ -32,7 +32,7 @@ public final class GameStateEvaluator2 {
public static PlayerEvaluateScore evaluate(UUID playerId, Game game, boolean useCombatPermanentScore) { public static PlayerEvaluateScore evaluate(UUID playerId, Game game, boolean useCombatPermanentScore) {
// TODO: add multi opponents support, so AI can take better actions // TODO: add multi opponents support, so AI can take better actions
Player player = game.getPlayer(playerId); Player player = game.getPlayer(playerId);
// must find all leaved opponents too // must find all leaved opponents
Player opponent = game.getPlayer(game.getOpponents(playerId, false).stream().findFirst().orElse(null)); Player opponent = game.getPlayer(game.getOpponents(playerId, false).stream().findFirst().orElse(null));
if (opponent == null) { if (opponent == null) {
return new PlayerEvaluateScore(playerId, WIN_GAME_SCORE); return new PlayerEvaluateScore(playerId, WIN_GAME_SCORE);

View file

@ -34,7 +34,8 @@ public class ActionSimulator {
} }
public int evaluateState() { public int evaluateState() {
Player opponent = game.getPlayer(game.getOpponents(player.getId(), true).stream().findFirst().orElse(null)); // must find all leaved opponents
Player opponent = game.getPlayer(game.getOpponents(player.getId(), false).stream().findFirst().orElse(null));
if (opponent == null) { if (opponent == null) {
return Integer.MAX_VALUE; return Integer.MAX_VALUE;
} }