summaryrefslogtreecommitdiff
path: root/backend/src/main
diff options
context:
space:
mode:
authorJoffrey BION <joffrey.bion@gmail.com>2018-07-16 02:19:16 +0200
committerJoffrey BION <joffrey.bion@gmail.com>2018-07-16 02:19:22 +0200
commitd1b3c9c9ff575fe0af010e7c335945f69232a2db (patch)
tree866ad9f462b5249550301653a1a682a5356d41a6 /backend/src/main
parentRework resources representations (diff)
downloadseven-wonders-d1b3c9c9ff575fe0af010e7c335945f69232a2db.tar.gz
seven-wonders-d1b3c9c9ff575fe0af010e7c335945f69232a2db.tar.bz2
seven-wonders-d1b3c9c9ff575fe0af010e7c335945f69232a2db.zip
Make GameDefinitionLoader a singleton object
Diffstat (limited to 'backend/src/main')
-rw-r--r--backend/src/main/kotlin/org/luxons/sevenwonders/repositories/LobbyRepository.kt4
1 files changed, 1 insertions, 3 deletions
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<Long, Lobby>()
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
}
bgstack15