diff options
Diffstat (limited to 'game-engine')
4 files changed, 4 insertions, 5 deletions
diff --git a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/GameDefinitionLoader.kt b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/GameDefinitionLoader.kt index 103adcae..e0f82c2b 100644 --- a/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/GameDefinitionLoader.kt +++ b/game-engine/src/main/kotlin/org/luxons/sevenwonders/game/data/GameDefinitionLoader.kt @@ -21,7 +21,7 @@ import org.luxons.sevenwonders.game.resources.Production import org.luxons.sevenwonders.game.resources.ResourceType import org.luxons.sevenwonders.game.resources.Resources -class GameDefinitionLoader { +object GameDefinitionLoader { val gameDefinition: GameDefinition by lazy { load() } diff --git a/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/GameTest.kt b/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/GameTest.kt index fb232d9e..135f701d 100644 --- a/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/GameTest.kt +++ b/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/GameTest.kt @@ -38,7 +38,7 @@ class GameTest { private fun createGame(nbPlayers: Int): Game { val settings = testCustomizableSettings() - return GameDefinitionLoader().gameDefinition.initGame(0, settings, nbPlayers) + return GameDefinitionLoader.gameDefinition.initGame(0, settings, nbPlayers) } private fun playTurn(nbPlayers: Int, game: Game, ageToCheck: Int, handSize: Int) { diff --git a/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/data/GameDefinitionLoaderTest.kt b/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/data/GameDefinitionLoaderTest.kt index 468ee5de..c312c12f 100644 --- a/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/data/GameDefinitionLoaderTest.kt +++ b/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/data/GameDefinitionLoaderTest.kt @@ -7,8 +7,7 @@ class GameDefinitionLoaderTest { @Test fun successfulLoad() { - val loader = GameDefinitionLoader() - val gameDefinition = loader.gameDefinition + val gameDefinition = GameDefinitionLoader.gameDefinition assertNotNull(gameDefinition) } } diff --git a/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/data/GameDefinitionTest.kt b/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/data/GameDefinitionTest.kt index 3f010123..162af7a3 100644 --- a/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/data/GameDefinitionTest.kt +++ b/game-engine/src/test/kotlin/org/luxons/sevenwonders/game/data/GameDefinitionTest.kt @@ -9,7 +9,7 @@ class GameDefinitionTest { @Test fun successfulGameInit() { - val gameDefinition = GameDefinitionLoader().gameDefinition + val gameDefinition = GameDefinitionLoader.gameDefinition assertNotNull(gameDefinition) assertEquals(3, gameDefinition.minPlayers.toLong()) assertEquals(7, gameDefinition.maxPlayers.toLong()) |