More trees (same contributor)
[troll.git] / src / main / java / com / codingame / game / Referee.java
index eaac5fb..0c87bbf 100644 (file)
@@ -168,6 +168,7 @@ public class Referee extends AbstractReferee {
             if (model.haveWinner()) {
                 int loser = model.getLoser();
                 gameManager.addToGameSummary(GameManager.formatErrorMessage("Troll destroys " + gameManager.getPlayer(loser).getNicknameToken()) + ".");
+                gameManager.getPlayer(loser).view.destroy();
                 victory = true;
             }
             else if (model.exhausted()) exhausted = true;
@@ -187,16 +188,16 @@ public class Referee extends AbstractReferee {
 
         if (s0 > s1) {
             gameManager.addToGameSummary(GameManager.formatSuccessMessage(p0.getNicknameToken() + " wins."));
-            p1.view.destroy();
+            p1.view.markLoser();
         }
         else if (s0 < s1) {
             gameManager.addToGameSummary(GameManager.formatSuccessMessage(p1.getNicknameToken() + " wins."));
-            p0.view.destroy();
+            p0.view.markLoser();
         }
         else if (s0 < 0) {
             gameManager.addToGameSummary(GameManager.formatErrorMessage("Everybody loses!"));
-            p0.view.destroy();
-            p1.view.destroy();
+            p0.view.markLoser();
+            p1.view.markLoser();
         }
         else {
             gameManager.addToGameSummary("Draw.");