mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 12:22:10 -08:00
* Fixed draw handling. Fixed concede handling. Fixed message generation for game end view. Added some debug messages.
This commit is contained in:
parent
eb1e8dda14
commit
513b012dc0
13 changed files with 92 additions and 70 deletions
|
|
@ -97,24 +97,24 @@ public class GameEndView implements Serializable {
|
|||
if (matchPlayer.isMatchWinner()) {
|
||||
matchWinner = matchPlayer;
|
||||
}
|
||||
if (matchPlayer.hasTimerTimeout()) {
|
||||
if (matchPlayer.getPlayer().hasTimerTimeout()) {
|
||||
if (matchPlayer.getPlayer().equals(you)) {
|
||||
additonalText.append("You run out of time. ");
|
||||
} else {
|
||||
additonalText.append(matchPlayer.getName()).append(" runs out of time. ");
|
||||
}
|
||||
} else if (matchPlayer.hasQuit()) {
|
||||
if (matchPlayer.getPlayer().equals(you)) {
|
||||
additonalText.append("You have quit the match. ");
|
||||
} else {
|
||||
additonalText.append(matchPlayer.getName()).append(" has quit the match. ");
|
||||
}
|
||||
} else if (matchPlayer.getPlayer().hasIdleTimeout()) {
|
||||
if (matchPlayer.getPlayer().equals(you)) {
|
||||
additonalText.append("You lost the match for beeing idle. ");
|
||||
} else {
|
||||
additonalText.append(matchPlayer.getName()).append(" lost for beeing idle. ");
|
||||
}
|
||||
} else if (matchPlayer.hasQuit()) {
|
||||
if (matchPlayer.getPlayer().equals(you)) {
|
||||
additonalText.append("You have quit the match. ");
|
||||
} else {
|
||||
additonalText.append(matchPlayer.getName()).append(" has quit the match. ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ public class MatchView implements Serializable {
|
|||
this.matchName = match.getName();
|
||||
this.gameType = match.getOptions().getGameType();
|
||||
this.deckType = match.getOptions().getDeckType();
|
||||
|
||||
for (Game game: match.getGames()) {
|
||||
games.add(game.getId());
|
||||
}
|
||||
|
|
@ -75,15 +76,22 @@ public class MatchView implements Serializable {
|
|||
for (MatchPlayer matchPlayer: match.getPlayers()) {
|
||||
sb1.append(matchPlayer.getName());
|
||||
if(matchPlayer.hasQuit()) {
|
||||
if (matchPlayer.hasTimerTimeout()) {
|
||||
if (matchPlayer.getPlayer().hasTimerTimeout()) {
|
||||
sb1.append(" [timer] ");
|
||||
} else if (matchPlayer.getPlayer().hasIdleTimeout()) {
|
||||
sb1.append(" [idle] ");
|
||||
} else {
|
||||
sb1.append(" [quit] ");
|
||||
}
|
||||
}
|
||||
int lostGames = match.getNumGames() - (matchPlayer.getWins() + match.getDraws());
|
||||
sb1.append(", ");
|
||||
sb2.append(matchPlayer.getName()).append(" ");
|
||||
sb2.append(matchPlayer.getWins()).append("-").append(matchPlayer.getLoses()).append(", ");
|
||||
sb2.append(matchPlayer.getName()).append(" [");
|
||||
sb2.append(matchPlayer.getWins()).append("-");
|
||||
if (match.getDraws() > 0) {
|
||||
sb2.append(match.getDraws()).append("-");
|
||||
}
|
||||
sb2.append(lostGames).append("], ");
|
||||
}
|
||||
players = sb1.substring(0, sb1.length() - 2);
|
||||
result = sb2.substring(0, sb2.length() - 2);
|
||||
|
|
|
|||
|
|
@ -99,6 +99,9 @@ public class TableView implements Serializable {
|
|||
sbScore.insert(0,matchPlayer.getWins()).insert(0,"Score: ");
|
||||
}
|
||||
}
|
||||
if (table.getMatch().getDraws() > 0) {
|
||||
sbScore.append(" Draws: ").append(table.getMatch().getDraws());
|
||||
}
|
||||
this.controllerName += sb.toString();
|
||||
this.deckType = table.getDeckType();
|
||||
if (table.getMatch().getGames().isEmpty()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue