From 21357ae2173926ec1eb908517ab7b1b3e9175ee5 Mon Sep 17 00:00:00 2001 From: JBM Date: Tue, 9 Jun 2020 18:56:04 +0200 Subject: [PATCH] Start leaguifying --- PLAN.org | 1 + .../com/codingame/game/LeagueManager.java | 23 +++++++++++++++++++ src/main/java/com/codingame/game/Referee.java | 1 + 3 files changed, 25 insertions(+) create mode 100644 src/main/java/com/codingame/game/LeagueManager.java 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; -- 2.30.2