X-Git-Url: https://troll.desast.re/troll.git/blobdiff_plain/9656502aaa68fb88bfc0664b0d60e8ed25a9acb0..e9fb4b60ebdea1a383b0963aa71d0a3ffc1e3822:/src/main/java/com/codingame/game/Model.java?ds=sidebyside diff --git a/src/main/java/com/codingame/game/Model.java b/src/main/java/com/codingame/game/Model.java index 6eb0546..217388a 100644 --- a/src/main/java/com/codingame/game/Model.java +++ b/src/main/java/com/codingame/game/Model.java @@ -9,6 +9,7 @@ import com.google.inject.Inject; class Model { @Inject private MultiplayerGameManager gameManager; + long seed; Random random; int roadLength; int initialStones; @@ -18,8 +19,17 @@ class Model { class Player { com.codingame.game.Player gp; int index; + boolean hit; - Player(int i) { index = i; } + Player(int i) { + index = i; + hit = false; + } + + void loseRound() { + hit = true; + winner = 1 - index; + } private int castlePosition; public int getCastlePosition() { return castlePosition; } @@ -76,7 +86,8 @@ class Model { } } - void init(long seed) { + void init() { + seed = gameManager.getSeed(); random = new Random(seed); switch (random.nextInt(4)) { case 0: