Update statement to stabilize rule changes
[troll.git] / src / main / java / com / codingame / game / Referee.java
index 3aef88d..67d96e0 100644 (file)
@@ -9,17 +9,13 @@ import com.codingame.gameengine.core.AbstractPlayer.TimeoutException;
 import com.codingame.gameengine.core.AbstractReferee;
 import com.codingame.gameengine.core.GameManager;
 import com.codingame.gameengine.core.MultiplayerGameManager;
 import com.codingame.gameengine.core.AbstractReferee;
 import com.codingame.gameengine.core.GameManager;
 import com.codingame.gameengine.core.MultiplayerGameManager;
-import com.codingame.gameengine.module.entities.GraphicEntityModule;
-import com.codingame.gameengine.module.entities.Rectangle;
-import com.codingame.gameengine.module.entities.Sprite;
-import com.codingame.gameengine.module.entities.Text;
-import com.codingame.gameengine.module.entities.Curve;
+import com.codingame.game.GodModeManager;
 import com.google.inject.Inject;
 import com.google.inject.Provider;
 
 public class Referee extends AbstractReferee {
     @Inject private MultiplayerGameManager<Player> gameManager;
 import com.google.inject.Inject;
 import com.google.inject.Provider;
 
 public class Referee extends AbstractReferee {
     @Inject private MultiplayerGameManager<Player> gameManager;
-    @Inject private GraphicEntityModule graphicEntityModule;
+    @Inject private GodModeManager gm;
 
     @Inject private View view;
     @Inject private Model model;
 
     @Inject private View view;
     @Inject private Model model;
@@ -28,13 +24,14 @@ public class Referee extends AbstractReferee {
 
     @Override
     public void init() {
 
     @Override
     public void init() {
+        gm.init();
         model.init(gameManager.getSeed());
         gameManager.getPlayer(0).model = model.p0;
         gameManager.getPlayer(1).model = model.p1;
 
         for (Player p: gameManager.getPlayers()) {
             p.gameInit(model.roadLength, model.initialStones,
         model.init(gameManager.getSeed());
         gameManager.getPlayer(0).model = model.p0;
         gameManager.getPlayer(1).model = model.p1;
 
         for (Player p: gameManager.getPlayers()) {
             p.gameInit(model.roadLength, model.initialStones,
-                       gameManager.getSeed());
+                       gameManager.getSeed(), gm.getSalt());
         }
 
         view.init(model);
         }
 
         view.init(model);
@@ -71,7 +68,7 @@ public class Referee extends AbstractReferee {
          * least.
          */
         for (Player player : gameManager.getActivePlayers()) {
          * least.
          */
         for (Player player : gameManager.getActivePlayers()) {
-            player.receiveGameTurn();
+            player.receiveGameTurn(); gm.transcend(player);
             switch (player.type) {
             case Timeout:
                 disqualify(player, "T/O", "timed out!");
             switch (player.type) {
             case Timeout:
                 disqualify(player, "T/O", "timed out!");
@@ -122,6 +119,7 @@ public class Referee extends AbstractReferee {
          * exhaustion).
          */
         int delta = 0;
          * exhaustion).
          */
         int delta = 0;
+        gm.update(gameManager.getPlayers());
         for (Player player : gameManager.getActivePlayers()) {
             player.view.throwStones(player.stoneThrow);
             delta += player.model.getMultiplier() * player.stoneThrow;
         for (Player player : gameManager.getActivePlayers()) {
             player.view.throwStones(player.stoneThrow);
             delta += player.model.getMultiplier() * player.stoneThrow;