mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
When playing non-team matches, display Player name as winner in Game Recap screen
This commit is contained in:
@@ -47,7 +47,12 @@ public class GameStateEvaluator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Score getScoreForGameOver(Game game, Player aiPlayer) {
|
private Score getScoreForGameOver(Game game, Player aiPlayer) {
|
||||||
return game.getOutcome().getWinningTeam() == aiPlayer.getTeam() ? new Score(Integer.MAX_VALUE) : new Score(Integer.MIN_VALUE);
|
if (game.getOutcome().getWinningTeam() == aiPlayer.getTeam() ||
|
||||||
|
game.getOutcome().isWinner(aiPlayer.getRegisteredPlayer())) {
|
||||||
|
return new Score(Integer.MAX_VALUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Score(Integer.MIN_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Score getScoreForGameState(Game game, Player aiPlayer) {
|
public Score getScoreForGameState(Game game, Player aiPlayer) {
|
||||||
|
|||||||
@@ -92,8 +92,8 @@ public final class GameOutcome implements Iterable<Entry<RegisteredPlayer, Playe
|
|||||||
this.playerRating.put(p.getRegisteredPlayer(), p.getStats());
|
this.playerRating.put(p.getRegisteredPlayer(), p.getStats());
|
||||||
this.playerNames.put(p.getRegisteredPlayer(), p.getName());
|
this.playerNames.put(p.getRegisteredPlayer(), p.getName());
|
||||||
|
|
||||||
if (p.getOutcome().hasWon() &&
|
if (p.getOutcome().hasWon() && winCondition == GameEndReason.AllOpposingTeamsLost) {
|
||||||
(winCondition == GameEndReason.AllOpponentsLost || winCondition == GameEndReason.AllOpposingTeamsLost)) {
|
// Only mark the WinningTeam when "Team mode" is on.
|
||||||
winningTeam = p.getTeam();
|
winningTeam = p.getTeam();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user