From: JBM Date: Tue, 9 Jun 2020 16:56:04 +0000 (+0200) Subject: Start leaguifying X-Git-Url: https://troll.desast.re/troll.git/commitdiff_plain/21357ae2173926ec1eb908517ab7b1b3e9175ee5 Start leaguifying --- diff --git a/PLAN.org b/PLAN.org index a838764..e31b52c 100644 --- a/PLAN.org +++ b/PLAN.org @@ -49,6 +49,7 @@ ** DONE html for salting the seed ** TODO Leagues (need multiround) ** TODO Multiround (need early termination) +** TODO Leaguification ** DONE Early termination (need time rationalization) ** DONE Time rationalization (need code reorg) ** TODO Code cleanup diff --git a/src/main/java/com/codingame/game/LeagueManager.java b/src/main/java/com/codingame/game/LeagueManager.java new file mode 100644 index 0000000..ed7d455 --- /dev/null +++ b/src/main/java/com/codingame/game/LeagueManager.java @@ -0,0 +1,23 @@ +package com.codingame.game; + +import com.codingame.gameengine.core.MultiplayerGameManager; +import com.codingame.gameengine.core.AbstractMultiplayerPlayer; +import com.google.inject.Inject; +import com.google.inject.Singleton; + +@Singleton +class LeagueManager { + enum CheatLevel { + ALLOWED, + TOLERATED, + FORBIDDEN + } + + CheatLevel cheatLevel; + + @Inject + LeagueManager(MultiplayerGameManager gameManager) + { + cheatLevel = CheatLevel.FORBIDDEN; + } +} diff --git a/src/main/java/com/codingame/game/Referee.java b/src/main/java/com/codingame/game/Referee.java index 3de5140..19ef894 100644 --- a/src/main/java/com/codingame/game/Referee.java +++ b/src/main/java/com/codingame/game/Referee.java @@ -14,6 +14,7 @@ import com.google.inject.Provider; public class Referee extends AbstractReferee { @Inject private GameManager gameManager; @Inject private GodModeManager gm; + @Inject private LeagueManager league; @Inject private View view; @Inject private Model model;