Ça trolle…
/
troll.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
FIX: IT belongs in a MODEL!
[troll.git]
/
src
/
main
/
java
/
com
/
codingame
/
game
/
LeagueManager.java
diff --git
a/src/main/java/com/codingame/game/LeagueManager.java
b/src/main/java/com/codingame/game/LeagueManager.java
index
94a7f5f
..
78f15f1
100644
(file)
--- a/
src/main/java/com/codingame/game/LeagueManager.java
+++ b/
src/main/java/com/codingame/game/LeagueManager.java
@@
-12,15
+12,34
@@
class LeagueManager {
TOLERATED,
FORBIDDEN
}
TOLERATED,
FORBIDDEN
}
-
CheatLevel cheatLevel;
CheatLevel cheatLevel;
+ enum MapLevel {
+ SINGLE,
+ DISCRETE,
+ CONTINUOUS
+ }
+ MapLevel mapLevel;
+
+ enum FixLevel { SOMETIMES, NEVER }
+ FixLevel fixLevel;
+
@Inject
LeagueManager(MultiplayerGameManager<AbstractMultiplayerPlayer> gameManager)
{
int level = gameManager.getLeagueLevel();
@Inject
LeagueManager(MultiplayerGameManager<AbstractMultiplayerPlayer> gameManager)
{
int level = gameManager.getLeagueLevel();
+ if (level < 1 || level > 3) {
+ throw new InternalError("This game does not implement level " + level);
+ }
+
cheatLevel = level <= 1 ? CheatLevel.ALLOWED
: level <= 2 ? CheatLevel.TOLERATED
: CheatLevel.FORBIDDEN;
cheatLevel = level <= 1 ? CheatLevel.ALLOWED
: level <= 2 ? CheatLevel.TOLERATED
: CheatLevel.FORBIDDEN;
+
+ mapLevel = level <= 1 ? MapLevel.SINGLE
+ : level <= 2 ? MapLevel.DISCRETE
+ : MapLevel.CONTINUOUS;
+
+ fixLevel = level <= 1 ? FixLevel.SOMETIMES : FixLevel.NEVER;
}
}
}
}