Organized files

This commit is contained in:
Yair Morgenstern 2018-06-26 08:19:41 +03:00
parent 805fc5c739
commit 23f9d157a4
17 changed files with 35 additions and 28 deletions

View file

@ -1,4 +1,4 @@
package com.unciv.ui
package com.unciv
class GameSettings : LinkedHashMap<String, String>() {

View file

@ -5,7 +5,6 @@ import com.badlogic.gdx.Gdx
import com.unciv.logic.GameInfo
import com.unciv.logic.GameSaver
import com.unciv.models.gamebasics.GameBasics
import com.unciv.ui.GameSettings
import com.unciv.ui.worldscreen.WorldScreen
class UnCivGame : Game() {

View file

@ -3,7 +3,7 @@ package com.unciv.logic
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.files.FileHandle
import com.badlogic.gdx.utils.Json
import com.unciv.ui.GameSettings
import com.unciv.GameSettings
class GameSaver {
private val saveFilesFolder = "SaveFiles"
@ -34,7 +34,7 @@ class GameSaver {
return Gdx.files.local("GameSettings.json")
}
fun getGeneralSettings():GameSettings{
fun getGeneralSettings(): GameSettings {
val settingsFile = getGeneralSettingsFile()
if(!settingsFile.exists()) return GameSettings()
return Json().fromJson(GameSettings::class.java, settingsFile)

View file

@ -153,5 +153,4 @@ class Battle(val gameInfo:GameInfo=UnCivGame.Current.gameInfo) {
capturedUnit.civInfo = attacker.getCivilization()
capturedUnit.owner = capturedUnit.civInfo.civName
}
}
}

View file

@ -9,7 +9,7 @@ import com.unciv.logic.map.TileMap
import com.unciv.models.gamebasics.GameBasics
import com.unciv.models.gamebasics.tile.ResourceType
import com.unciv.models.gamebasics.tile.TileResource
import com.unciv.models.linq.Counter
import com.unciv.models.Counter
import com.unciv.models.stats.Stats
import kotlin.math.min

View file

@ -9,10 +9,10 @@ import com.unciv.logic.map.RoadStatus
import com.unciv.logic.map.TileInfo
import com.unciv.models.gamebasics.Civilization
import com.unciv.models.gamebasics.GameBasics
import com.unciv.models.gamebasics.TechEra
import com.unciv.models.gamebasics.tech.TechEra
import com.unciv.models.gamebasics.tile.ResourceType
import com.unciv.models.gamebasics.tile.TileResource
import com.unciv.models.linq.Counter
import com.unciv.models.Counter
import com.unciv.models.stats.Stats
import com.unciv.ui.utils.getRandom
import kotlin.math.max

View file

@ -1,6 +1,6 @@
package com.unciv.logic.civilization
import com.unciv.models.linq.Counter
import com.unciv.models.Counter
class ScienceVictoryManager {

View file

@ -3,7 +3,7 @@ package com.unciv.logic.civilization
import com.badlogic.gdx.graphics.Color
import com.unciv.models.gamebasics.GameBasics
import com.unciv.models.gamebasics.Technology
import com.unciv.models.gamebasics.tech.Technology
import com.unciv.models.gamebasics.unit.Unit
import com.unciv.ui.utils.tr
import java.util.*

View file

@ -112,7 +112,7 @@ open class TileInfo {
if (improvement.improvingTech != null && observingCiv.tech.isResearched(improvement.improvingTech!!)) stats.add(improvement.improvingTechStats!!) // eg Chemistry for mines
if (improvement.name == "Trading post" && city != null && city.civInfo.policies.isAdopted("Free Thought"))
stats.science += 1f
if (listOf("Academy", "Landmark", "Manufactory", "Customs House").contains(improvement.name) && observingCiv.policies.isAdopted("Freedom Complete"))
if (improvement.name in listOf("Academy", "Landmark", "Manufactory", "Customs house") && observingCiv.policies.isAdopted("Freedom Complete"))
stats.add(improvement) // again, for the double effect
}

View file

@ -1,4 +1,4 @@
package com.unciv.models.linq;
package com.unciv.models;
import java.util.LinkedHashMap;

View file

@ -2,6 +2,7 @@ package com.unciv.models.gamebasics
import com.unciv.logic.city.CityConstructions
import com.unciv.logic.city.IConstruction
import com.unciv.models.gamebasics.tech.Technology
import com.unciv.models.stats.NamedStats
import com.unciv.models.stats.Stats
import com.unciv.ui.utils.tr

View file

@ -2,6 +2,8 @@ package com.unciv.models.gamebasics
import com.badlogic.gdx.Gdx
import com.badlogic.gdx.utils.Json
import com.unciv.models.gamebasics.tech.TechColumn
import com.unciv.models.gamebasics.tech.Technology
import com.unciv.models.gamebasics.tile.Terrain
import com.unciv.models.gamebasics.tile.TileImprovement
import com.unciv.models.gamebasics.tile.TileResource

View file

@ -1,6 +1,8 @@
package com.unciv.models.gamebasics
import com.unciv.models.gamebasics.tech.TechEra
class PolicyBranch : Policy() {
var policies: ArrayList<Policy> = arrayListOf()
lateinit var era:TechEra
lateinit var era: TechEra
}

View file

@ -1,4 +1,4 @@
package com.unciv.models.gamebasics
package com.unciv.models.gamebasics.tech
import java.util.*
@ -12,13 +12,3 @@ class TechColumn {
}
enum class TechEra{
Ancient,
Classical,
Medieval,
Renaissance,
Industrial,
Modern,
Information,
Future
}

View file

@ -0,0 +1,12 @@
package com.unciv.models.gamebasics.tech
enum class TechEra{
Ancient,
Classical,
Medieval,
Renaissance,
Industrial,
Modern,
Information,
Future
}

View file

@ -1,6 +1,8 @@
package com.unciv.models.gamebasics
package com.unciv.models.gamebasics.tech
import com.unciv.UnCivGame
import com.unciv.models.gamebasics.GameBasics
import com.unciv.models.gamebasics.ICivilopedia
import com.unciv.ui.utils.tr
import java.util.*

View file

@ -6,7 +6,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.TextButton
import com.unciv.logic.civilization.CivilizationInfo
import com.unciv.logic.civilization.TechManager
import com.unciv.models.gamebasics.GameBasics
import com.unciv.models.gamebasics.Technology
import com.unciv.models.gamebasics.tech.Technology
import com.unciv.ui.utils.CameraStageBaseScreen
import com.unciv.ui.utils.addClickListener
import com.unciv.ui.utils.disable
@ -60,7 +60,7 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen()
selectTechnology(tech)
}
topTable.add(TB)
if(eras[j].text.toString()=="") eras[j].setText(tech.era().toString())
if(eras[j].text.toString()=="") eras[j].setText(tech.era().toString().tr())
}
}
}