Don't keep last stone throw count up after the fact
[troll.git] / src / main / java / com / codingame / game / Referee.java
index b56cade..166344b 100644 (file)
@@ -35,6 +35,7 @@ public class Referee extends AbstractReferee {
         }
 
         view.init(model);
+
         gameManager.getPlayer(0).view = view.p0;
         gameManager.getPlayer(1).view = view.p1;
 
@@ -45,6 +46,8 @@ public class Referee extends AbstractReferee {
     public void gameTurn(int turn) {
         // System.err.println("Starting turn " + turn);
 
+        view.startTurn();
+
         boolean disqual = false;
         boolean victory = false;
         boolean exhausted = false;
@@ -61,6 +64,8 @@ public class Referee extends AbstractReferee {
             player.execute();
         }
 
+        // SDK @#%^&! arbitrary sequence point: last input < first output
+
         for (Player player : gameManager.getActivePlayers()) {
             Model.Player p = player.model;
 
@@ -87,6 +92,7 @@ public class Referee extends AbstractReferee {
                 }
                 else if (stones > 0) {
                     player.view.animateStones(stones);
+                    player.view.updateStoneCounter();
                 }
             }
             catch (InvalidAction e) {