Skip to content

Commit

Permalink
Remove unused parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
yairm210 committed Jun 24, 2024
1 parent 77f0260 commit 7bd0a03
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ class CityConquestFunctions(val city: City) {
}
}

private fun removeBuildingsOnMoveToCiv(oldCiv: Civilization) {
private fun removeBuildingsOnMoveToCiv() {
// Remove all buildings provided for free to this city
// At this point, the city has *not* yet moved to the new civ
for (building in city.civ.civConstructions.getFreeBuildingNames(city)) {
city.cityConstructions.removeBuilding(building)
}
Expand Down Expand Up @@ -266,7 +267,7 @@ class CityConquestFunctions(val city: City) {
city.resetWLTKD()

// Remove their free buildings from this city and remove free buildings provided by the city from their cities
removeBuildingsOnMoveToCiv(oldCiv)
removeBuildingsOnMoveToCiv()

// Place palace for newCiv if this is the only city they have.
if (newCiv.cities.size == 1) newCiv.moveCapitalTo(city, null)
Expand Down
2 changes: 0 additions & 2 deletions core/src/com/unciv/models/ruleset/Building.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import com.unciv.models.ruleset.unique.UniqueTarget
import com.unciv.models.ruleset.unique.UniqueType
import com.unciv.models.stats.Stat
import com.unciv.models.stats.Stats
import com.unciv.models.translations.fillPlaceholders
import com.unciv.ui.components.extensions.getNeedMoreAmountString
import com.unciv.ui.components.extensions.toPercent
import com.unciv.ui.objectdescriptions.BuildingDescriptions
Expand Down Expand Up @@ -260,7 +259,6 @@ class Building : RulesetStatsObject(), INonPerpetualConstruction {
override fun getRejectionReasons(cityConstructions: CityConstructions): Sequence<RejectionReason> = sequence {
val cityCenter = cityConstructions.city.getCenterTile()
val civ = cityConstructions.city.civ
val ruleSet = civ.gameInfo.ruleset

if (cityConstructions.isBuilt(name))
yield(RejectionReasonType.AlreadyBuilt.toInstance())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.scenes.scene2d.Touchable
import com.badlogic.gdx.scenes.scene2d.ui.Label
import com.badlogic.gdx.scenes.scene2d.ui.Table
import com.unciv.UncivGame
import com.unciv.models.UncivSound
import com.unciv.models.ruleset.Building
import com.unciv.models.ruleset.IConstruction
Expand All @@ -23,7 +22,6 @@ import com.unciv.ui.images.ImageGetter
import com.unciv.ui.popups.ConfirmPopup
import com.unciv.ui.popups.closeAllPopups
import com.unciv.ui.screens.basescreen.BaseScreen
import com.unciv.ui.screens.civilopediascreen.CivilopediaScreen

class ConstructionInfoTable(val cityScreen: CityScreen) : Table() {
private val selectedConstructionTable = Table()
Expand Down Expand Up @@ -108,7 +106,7 @@ class ConstructionInfoTable(val cityScreen: CityScreen) : Table() {
sellBuildingButton.isEnabled = enableSell
if (sellBuildingButton.isEnabled) sellBuildingButton.onClick(UncivSound.Coin) {
sellBuildingButton.disable()
sellBuildingClicked(construction, isFree, sellText)
sellBuildingClicked(construction, sellText)
}

if (cityScreen.city.hasSoldBuildingThisTurn && !cityScreen.city.civ.gameInfo.gameParameters.godMode
Expand All @@ -119,7 +117,7 @@ class ConstructionInfoTable(val cityScreen: CityScreen) : Table() {
}
}

private fun sellBuildingClicked(construction: Building, isFree: Boolean, sellText: String) {
private fun sellBuildingClicked(construction: Building, sellText: String) {
cityScreen.closeAllPopups()

ConfirmPopup(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import com.unciv.ui.components.input.onChange
import com.unciv.ui.components.widgets.TranslatedSelectBox
import com.unciv.ui.screens.basescreen.BaseScreen

class MapOptionsTable(private val newGameScreen: NewGameScreen, isReset: Boolean = true) : Table() {
class MapOptionsTable(private val newGameScreen: NewGameScreen) : Table() {

private val mapParameters = newGameScreen.gameSetupInfo.mapParameters
private var mapTypeSpecificTable = Table()
Expand Down
7 changes: 3 additions & 4 deletions core/src/com/unciv/ui/screens/newgamescreen/NewGameScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ import kotlin.math.floor
import com.unciv.ui.components.widgets.AutoScrollPane as ScrollPane

class NewGameScreen(
defaultGameSetupInfo: GameSetupInfo? = null,
isReset: Boolean = false
defaultGameSetupInfo: GameSetupInfo? = null
): IPreviousScreen, PickerScreen(), RecreateOnResize {

override val gameSetupInfo = defaultGameSetupInfo ?: GameSetupInfo.fromSettings()
Expand Down Expand Up @@ -79,7 +78,7 @@ class NewGameScreen(
updatePlayerPickerTable = { desiredCiv -> playerPickerTable.update(desiredCiv) },
updatePlayerPickerRandomLabel = { playerPickerTable.updateRandomNumberLabel() }
)
mapOptionsTable = MapOptionsTable(this, isReset)
mapOptionsTable = MapOptionsTable(this)
closeButton.onActivation {
mapOptionsTable.cancelBackgroundJobs()
game.popScreen()
Expand All @@ -102,7 +101,7 @@ class NewGameScreen(
"Are you sure you want to reset all game options to defaults?",
"Reset to defaults",
) {
game.replaceCurrentScreen(NewGameScreen(GameSetupInfo(), isReset = true))
game.replaceCurrentScreen(NewGameScreen(GameSetupInfo()))
}.open(true)
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/com/unciv/ui/screens/worldscreen/WorldScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class WorldScreen(
fun openDeveloperConsole() {
// No cheating unless you're by yourself
if (gameInfo.civilizations.count { it.isHuman() } > 1) return
val consolePopup = DevConsolePopup(this)
DevConsolePopup(this)
}

private fun toggleUI() {
Expand Down
2 changes: 1 addition & 1 deletion server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ for (platform in Platform.values()) {

val platformNameForPackrCmd =
if (platform == Platform.MacOS) "mac"
else platform.name.toLowerCase()
else platform.name.lowercase()

val command = "java -jar $rootDir/packr-all-4.0.0.jar" +
" --platform $platformNameForPackrCmd" +
Expand Down

0 comments on commit 7bd0a03

Please sign in to comment.