94a7f5fc73ec2efe1f104e5f8c7fbb8843a079eb
[troll.git] / src / main / java / com / codingame / game / LeagueManager.java
1 package com.codingame.game;
2
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;
7
8 @Singleton
9 class LeagueManager {
10     enum CheatLevel {
11         ALLOWED,
12         TOLERATED,
13         FORBIDDEN
14     }
15
16     CheatLevel cheatLevel;
17
18     @Inject
19     LeagueManager(MultiplayerGameManager<AbstractMultiplayerPlayer> gameManager)
20     {
21         int level = gameManager.getLeagueLevel();
22         cheatLevel = level <= 1 ? CheatLevel.ALLOWED
23                    : level <= 2 ? CheatLevel.TOLERATED
24                    : CheatLevel.FORBIDDEN;
25     }    
26 }