From d1b3c9c9ff575fe0af010e7c335945f69232a2db Mon Sep 17 00:00:00 2001 From: Joffrey BION Date: Mon, 16 Jul 2018 02:19:16 +0200 Subject: Make GameDefinitionLoader a singleton object --- .../kotlin/org/luxons/sevenwonders/repositories/LobbyRepository.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'backend/src/main') diff --git a/backend/src/main/kotlin/org/luxons/sevenwonders/repositories/LobbyRepository.kt b/backend/src/main/kotlin/org/luxons/sevenwonders/repositories/LobbyRepository.kt index 261f723c..7ca78233 100644 --- a/backend/src/main/kotlin/org/luxons/sevenwonders/repositories/LobbyRepository.kt +++ b/backend/src/main/kotlin/org/luxons/sevenwonders/repositories/LobbyRepository.kt @@ -10,8 +10,6 @@ import java.util.HashMap @Repository class LobbyRepository @Autowired constructor() { - private val gameDefinitionLoader: GameDefinitionLoader = GameDefinitionLoader() - private val lobbies = HashMap() private var lastGameId: Long = 0 @@ -20,7 +18,7 @@ class LobbyRepository @Autowired constructor() { fun create(gameName: String, owner: Player): Lobby { val id = lastGameId++ - val lobby = Lobby(id, gameName, owner, gameDefinitionLoader.gameDefinition) + val lobby = Lobby(id, gameName, owner, GameDefinitionLoader.gameDefinition) lobbies[id] = lobby return lobby } -- cgit