mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-19 16:57:38 +07:00
'random generated map type' is actually random
This commit is contained in:
parent
17ad432228
commit
e44af219eb
@ -14,7 +14,6 @@ import com.unciv.logic.map.MapShape
|
|||||||
import com.unciv.logic.map.MapSize
|
import com.unciv.logic.map.MapSize
|
||||||
import com.unciv.logic.map.MapSizeNew
|
import com.unciv.logic.map.MapSizeNew
|
||||||
import com.unciv.logic.map.MapType
|
import com.unciv.logic.map.MapType
|
||||||
import com.unciv.logic.map.mapgenerator.MapGenerationRandomness
|
|
||||||
import com.unciv.ui.components.ExpanderTab
|
import com.unciv.ui.components.ExpanderTab
|
||||||
import com.unciv.ui.components.UncivSlider
|
import com.unciv.ui.components.UncivSlider
|
||||||
import com.unciv.ui.components.UncivTextField
|
import com.unciv.ui.components.UncivTextField
|
||||||
@ -47,8 +46,6 @@ class MapParametersTable(
|
|||||||
lateinit var customMapWidth: TextField
|
lateinit var customMapWidth: TextField
|
||||||
lateinit var customMapHeight: TextField
|
lateinit var customMapHeight: TextField
|
||||||
|
|
||||||
private val randomness = MapGenerationRandomness()
|
|
||||||
|
|
||||||
private lateinit var worldSizeSelectBox: TranslatedSelectBox
|
private lateinit var worldSizeSelectBox: TranslatedSelectBox
|
||||||
private var customWorldSizeTable = Table ()
|
private var customWorldSizeTable = Table ()
|
||||||
private var hexagonalSizeTable = Table()
|
private var hexagonalSizeTable = Table()
|
||||||
@ -111,9 +108,9 @@ class MapParametersTable(
|
|||||||
mapShapesOptionsValues = mapShapes.toHashSet()
|
mapShapesOptionsValues = mapShapes.toHashSet()
|
||||||
val optionsTable = MultiCheckboxTable("{Enabled Map Shapes}", "NewGameMapShapes", mapShapesOptionsValues) {
|
val optionsTable = MultiCheckboxTable("{Enabled Map Shapes}", "NewGameMapShapes", mapShapesOptionsValues) {
|
||||||
if (mapShapesOptionsValues.isEmpty()) {
|
if (mapShapesOptionsValues.isEmpty()) {
|
||||||
mapParameters.shape = mapShapes.random(randomness.RNG)
|
mapParameters.shape = mapShapes.random()
|
||||||
} else {
|
} else {
|
||||||
mapParameters.shape = mapShapesOptionsValues.random(randomness.RNG)
|
mapParameters.shape = mapShapesOptionsValues.random()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
add(optionsTable).colspan(2).grow().row()
|
add(optionsTable).colspan(2).grow().row()
|
||||||
@ -148,9 +145,9 @@ class MapParametersTable(
|
|||||||
mapTypesOptionsValues = mapTypes.toHashSet()
|
mapTypesOptionsValues = mapTypes.toHashSet()
|
||||||
val optionsTable = MultiCheckboxTable("{Enabled Map Generation Types}", "NewGameMapGenerationTypes", mapTypesOptionsValues) {
|
val optionsTable = MultiCheckboxTable("{Enabled Map Generation Types}", "NewGameMapGenerationTypes", mapTypesOptionsValues) {
|
||||||
if (mapTypesOptionsValues.isEmpty()) {
|
if (mapTypesOptionsValues.isEmpty()) {
|
||||||
mapParameters.type = mapTypes.random(randomness.RNG)
|
mapParameters.type = mapTypes.random()
|
||||||
} else {
|
} else {
|
||||||
mapParameters.type = mapTypesOptionsValues.random(randomness.RNG)
|
mapParameters.type = mapTypesOptionsValues.random()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
add(optionsTable).colspan(2).grow().row()
|
add(optionsTable).colspan(2).grow().row()
|
||||||
@ -176,9 +173,9 @@ class MapParametersTable(
|
|||||||
mapSizesOptionsValues = mapSizes.toHashSet()
|
mapSizesOptionsValues = mapSizes.toHashSet()
|
||||||
val optionsTable = MultiCheckboxTable("{Enabled World Sizes}", "NewGameWorldSizes", mapSizesOptionsValues) {
|
val optionsTable = MultiCheckboxTable("{Enabled World Sizes}", "NewGameWorldSizes", mapSizesOptionsValues) {
|
||||||
if (mapSizesOptionsValues.isEmpty()) {
|
if (mapSizesOptionsValues.isEmpty()) {
|
||||||
mapParameters.mapSize = MapSizeNew(mapSizes.random(randomness.RNG))
|
mapParameters.mapSize = MapSizeNew(mapSizes.random())
|
||||||
} else {
|
} else {
|
||||||
mapParameters.mapSize = MapSizeNew(mapSizesOptionsValues.random(randomness.RNG))
|
mapParameters.mapSize = MapSizeNew(mapSizesOptionsValues.random())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
add(optionsTable).colspan(2).grow().row()
|
add(optionsTable).colspan(2).grow().row()
|
||||||
@ -269,9 +266,9 @@ class MapParametersTable(
|
|||||||
mapResourcesOptionsValues = mapResources.toHashSet()
|
mapResourcesOptionsValues = mapResources.toHashSet()
|
||||||
val optionsTable = MultiCheckboxTable("{Enabled Resource Settings}", "NewGameResourceSettings", mapResourcesOptionsValues) {
|
val optionsTable = MultiCheckboxTable("{Enabled Resource Settings}", "NewGameResourceSettings", mapResourcesOptionsValues) {
|
||||||
if (mapResourcesOptionsValues.isEmpty()) {
|
if (mapResourcesOptionsValues.isEmpty()) {
|
||||||
mapParameters.mapResources = mapResources.random(randomness.RNG)
|
mapParameters.mapResources = mapResources.random()
|
||||||
} else {
|
} else {
|
||||||
mapParameters.mapResources = mapResourcesOptionsValues.random(randomness.RNG)
|
mapParameters.mapResources = mapResourcesOptionsValues.random()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
add(optionsTable).colspan(2).grow().row()
|
add(optionsTable).colspan(2).grow().row()
|
||||||
|
Loading…
Reference in New Issue
Block a user