1 package com.codingame.game;
3 import com.codingame.gameengine.core.MultiplayerGameManager;
4 import com.codingame.gameengine.core.AbstractMultiplayerPlayer;
5 import com.google.inject.Inject;
6 import com.google.inject.Singleton;
15 CheatLevel cheatLevel;
24 enum FixLevel { SOMETIMES, NEVER }
28 LeagueManager(MultiplayerGameManager<AbstractMultiplayerPlayer> gameManager)
30 int level = gameManager.getLeagueLevel();
31 if (level < 1 || level > 3) {
32 throw new InternalError("This game does not implement level " + level);
35 cheatLevel = level <= 1 ? CheatLevel.ALLOWED
36 : level <= 2 ? CheatLevel.TOLERATED
37 : CheatLevel.FORBIDDEN;
39 mapLevel = level <= 1 ? MapLevel.SINGLE
40 : level <= 2 ? MapLevel.DISCRETE
41 : MapLevel.CONTINUOUS;
43 fixLevel = level <= 1 ? FixLevel.SOMETIMES : FixLevel.NEVER;