Simulation civ names are constants, so we can reference them from wherever inside the code for A/B testing

This commit is contained in:
yairm210 2024-07-03 18:34:50 +03:00
parent e397c52f4c
commit fba4128c02
2 changed files with 9 additions and 3 deletions

View File

@ -88,6 +88,9 @@ object Constants {
const val uniqueOrDelimiter = "\" OR \""
const val simulationCiv1 = "SimulationCiv1"
const val simulationCiv2 = "SimulationCiv2"
const val dropboxMultiplayerServer = "Dropbox"
const val uncivXyzServer = "https://uncivserver.xyz"

View File

@ -1,6 +1,8 @@
package com.unciv.app.desktop
import com.unciv.Constants
import com.unciv.Constants.simulationCiv1
import com.unciv.Constants.simulationCiv2
import com.unciv.UncivGame
import com.unciv.logic.GameStarter
import com.unciv.logic.civilization.PlayerType
@ -18,6 +20,7 @@ import java.util.LinkedHashSet
import kotlin.time.ExperimentalTime
internal object ConsoleLauncher {
// To run,set working directory to android/assets in run configuration
@ExperimentalTime
@JvmStatic
@ -38,10 +41,10 @@ internal object ConsoleLauncher {
val ruleset = RulesetCache[BaseRuleset.Civ_V_GnK.fullName]!!
ruleset.nations["GenericCiv1"] = Nation().apply { name = "GenericCiv1" }
ruleset.nations["GenericCiv2"] = Nation().apply { name = "GenericCiv2" }
ruleset.nations[simulationCiv1] = Nation().apply { name = simulationCiv1 }
ruleset.nations[simulationCiv2] = Nation().apply { name = simulationCiv2 }
val gameParameters = getGameParameters("GenericCiv1", "GenericCiv2")
val gameParameters = getGameParameters(simulationCiv1, simulationCiv2)
val mapParameters = getMapParameters()
val gameSetupInfo = GameSetupInfo(gameParameters, mapParameters)
val newGame = GameStarter.startNewGame(gameSetupInfo)