diff options
author | jbion <joffrey.bion@amadeus.com> | 2019-02-18 17:54:33 +0100 |
---|---|---|
committer | jbion <joffrey.bion@amadeus.com> | 2019-02-18 17:54:33 +0100 |
commit | 86f7101b6e6bafd5cbfb0b1db2d162a4510a097e (patch) | |
tree | 5a74a64e4ba7b705900be22ba1b71cd60c49fb05 /backend/src | |
parent | Reduce visibility where appropriate (diff) | |
download | seven-wonders-86f7101b6e6bafd5cbfb0b1db2d162a4510a097e.tar.gz seven-wonders-86f7101b6e6bafd5cbfb0b1db2d162a4510a097e.tar.bz2 seven-wonders-86f7101b6e6bafd5cbfb0b1db2d162a4510a097e.zip |
Simplify game init API
Diffstat (limited to 'backend/src')
3 files changed, 4 insertions, 5 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 7ca78233..768aa659 100644 --- a/backend/src/main/kotlin/org/luxons/sevenwonders/repositories/LobbyRepository.kt +++ b/backend/src/main/kotlin/org/luxons/sevenwonders/repositories/LobbyRepository.kt @@ -1,6 +1,6 @@ package org.luxons.sevenwonders.repositories -import org.luxons.sevenwonders.game.data.GameDefinitionLoader +import org.luxons.sevenwonders.game.data.GameDefinition import org.luxons.sevenwonders.lobby.Lobby import org.luxons.sevenwonders.lobby.Player import org.springframework.beans.factory.annotation.Autowired @@ -18,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, GameDefinition.load()) lobbies[id] = lobby return lobby } diff --git a/backend/src/test/kotlin/org/luxons/sevenwonders/controllers/LobbyControllerTest.kt b/backend/src/test/kotlin/org/luxons/sevenwonders/controllers/LobbyControllerTest.kt index 4780c533..5ace12af 100644 --- a/backend/src/test/kotlin/org/luxons/sevenwonders/controllers/LobbyControllerTest.kt +++ b/backend/src/test/kotlin/org/luxons/sevenwonders/controllers/LobbyControllerTest.kt @@ -9,7 +9,7 @@ import org.junit.Test import org.luxons.sevenwonders.actions.ReorderPlayersAction import org.luxons.sevenwonders.actions.UpdateSettingsAction import org.luxons.sevenwonders.game.api.CustomizableSettings -import org.luxons.sevenwonders.game.data.WonderSidePickMethod.ALL_A +import org.luxons.sevenwonders.game.api.WonderSidePickMethod.ALL_A import org.luxons.sevenwonders.lobby.Lobby import org.luxons.sevenwonders.lobby.Player import org.luxons.sevenwonders.lobby.PlayerIsNotOwnerException diff --git a/backend/src/test/kotlin/org/luxons/sevenwonders/lobby/LobbyTest.kt b/backend/src/test/kotlin/org/luxons/sevenwonders/lobby/LobbyTest.kt index f989edbc..1d8b0f4d 100644 --- a/backend/src/test/kotlin/org/luxons/sevenwonders/lobby/LobbyTest.kt +++ b/backend/src/test/kotlin/org/luxons/sevenwonders/lobby/LobbyTest.kt @@ -17,7 +17,6 @@ import org.junit.rules.ExpectedException import org.junit.runner.RunWith import org.luxons.sevenwonders.game.api.CustomizableSettings import org.luxons.sevenwonders.game.data.GameDefinition -import org.luxons.sevenwonders.game.data.GameDefinitionLoader import org.luxons.sevenwonders.lobby.Lobby.GameAlreadyStartedException import org.luxons.sevenwonders.lobby.Lobby.PlayerNameAlreadyUsedException import org.luxons.sevenwonders.lobby.Lobby.PlayerOverflowException @@ -231,7 +230,7 @@ class LobbyTest { @JvmStatic @BeforeClass fun loadDefinition() { - gameDefinition = GameDefinitionLoader.gameDefinition + gameDefinition = GameDefinition.load() } } } |