Changes to provide Random Order of Civs in sims (#12656)

This commit is contained in:
itanasi 2024-12-15 11:54:20 -08:00 committed by GitHub
parent 02fdeb1755
commit fcdf6cba5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 1 deletions

View File

@ -349,7 +349,12 @@ object GameStarter {
.map { it.key }
.filter { it in usedCivNames }
for (player in chosenPlayers) {
val playersToAdd = if (newGameParameters.shufflePlayerOrder) {
chosenPlayers.toMutableList().apply { shuffle() }
} else {
chosenPlayers
}
for (player in playersToAdd) {
val civ = Civilization(player.chosenCiv)
when (player.chosenCiv) {
in usedMajorCivs, Constants.spectator -> {

View File

@ -31,6 +31,7 @@ class GameParameters : IsPartOfGameInfoSerialization { // Default values are the
var nuclearWeaponsEnabled = true
var espionageEnabled = false
var noStartBias = false
var shufflePlayerOrder = false
var victoryTypes: ArrayList<String> = arrayListOf()
var startingEra = "Ancient era"
@ -71,6 +72,7 @@ class GameParameters : IsPartOfGameInfoSerialization { // Default values are the
parameters.nuclearWeaponsEnabled = nuclearWeaponsEnabled
parameters.espionageEnabled = espionageEnabled
parameters.noStartBias = noStartBias
parameters.shufflePlayerOrder = shufflePlayerOrder
parameters.victoryTypes = ArrayList(victoryTypes)
parameters.startingEra = startingEra
parameters.isOnlineMultiplayer = isOnlineMultiplayer

View File

@ -79,6 +79,7 @@ internal object ConsoleLauncher {
numberOfCityStates = 0
speed = Speed.DEFAULT
noBarbarians = true
shufflePlayerOrder = true
players = ArrayList<Player>().apply {
civilizations.forEach { add(Player(it)) }
add(Player(Constants.spectator, PlayerType.Human))