Announce it's the loser who gets destroyed instead of the winner. (spotted by @Astrob...
[troll.git] / src / main / java / com / codingame / game / Referee.java
index 166344b..b678534 100644 (file)
@@ -137,8 +137,8 @@ public class Referee extends AbstractReferee {
             }
 
             if (model.haveWinner()) {
             }
 
             if (model.haveWinner()) {
-                int winner = model.getWinner();
-                gameManager.addToGameSummary(GameManager.formatErrorMessage("Troll destroys " + gameManager.getPlayer(winner).getNicknameToken()));
+                int loser = model.getLoser();
+                gameManager.addToGameSummary(GameManager.formatErrorMessage("Troll destroys " + gameManager.getPlayer(loser).getNicknameToken()) + ".");
                 victory = true;
             }
             else if (model.exhausted()) exhausted = true;
                 victory = true;
             }
             else if (model.exhausted()) exhausted = true;
@@ -157,11 +157,11 @@ public class Referee extends AbstractReferee {
         int s1 = p1.getScore();
 
         if (s0 > s1) {
         int s1 = p1.getScore();
 
         if (s0 > s1) {
-            gameManager.addToGameSummary(GameManager.formatSuccessMessage(p0.getNicknameToken() + " wins"));
+            gameManager.addToGameSummary(GameManager.formatSuccessMessage(p0.getNicknameToken() + " wins."));
             p1.view.destroy();
         }
         else if (s0 < s1) {
             p1.view.destroy();
         }
         else if (s0 < s1) {
-            gameManager.addToGameSummary(GameManager.formatSuccessMessage(p1.getNicknameToken() + " wins"));
+            gameManager.addToGameSummary(GameManager.formatSuccessMessage(p1.getNicknameToken() + " wins."));
             p0.view.destroy();
         }
         else if (s0 < 0) {
             p0.view.destroy();
         }
         else if (s0 < 0) {