Ça trolle…
/
troll.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Facade the SDK's GameManager out
[troll.git]
/
src
/
main
/
java
/
com
/
codingame
/
game
/
Model.java
diff --git
a/src/main/java/com/codingame/game/Model.java
b/src/main/java/com/codingame/game/Model.java
index
6eb0546
..
108b5a6
100644
(file)
--- 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<com.codingame.game.Player> gameManager;
class Model {
@Inject private MultiplayerGameManager<com.codingame.game.Player> gameManager;
+ long seed;
Random random;
int roadLength;
int initialStones;
Random random;
int roadLength;
int initialStones;
@@
-18,8
+19,12
@@
class Model {
class Player {
com.codingame.game.Player gp;
int index;
class Player {
com.codingame.game.Player gp;
int index;
+ boolean hit;
- Player(int i) { index = i; }
+ Player(int i) {
+ index = i;
+ hit = false;
+ }
private int castlePosition;
public int getCastlePosition() { return castlePosition; }
private int castlePosition;
public int getCastlePosition() { return castlePosition; }
@@
-76,7
+81,8
@@
class Model {
}
}
}
}
- void init(long seed) {
+ void init() {
+ seed = gameManager.getSeed();
random = new Random(seed);
switch (random.nextInt(4)) {
case 0:
random = new Random(seed);
switch (random.nextInt(4)) {
case 0: