mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 05:46:43 -04:00
Lint
This commit is contained in:
parent
9533a35d15
commit
313f55171c
@ -4,7 +4,7 @@ import com.badlogic.gdx.Gdx
|
|||||||
import com.unciv.logic.map.TileMap
|
import com.unciv.logic.map.TileMap
|
||||||
import com.unciv.ui.saves.Gzip
|
import com.unciv.ui.saves.Gzip
|
||||||
|
|
||||||
class MapSaver(){
|
class MapSaver {
|
||||||
fun json() = GameSaver().json()
|
fun json() = GameSaver().json()
|
||||||
private val mapsFolder = "maps"
|
private val mapsFolder = "maps"
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ class BFS(val startingPoint: TileInfo, val predicate : (TileInfo) -> Boolean){
|
|||||||
for(tileInfo in tilesToCheck){
|
for(tileInfo in tilesToCheck){
|
||||||
for(neighbor in tileInfo.neighbors){
|
for(neighbor in tileInfo.neighbors){
|
||||||
if(predicate(neighbor) && !tilesReached.containsKey(neighbor)){
|
if(predicate(neighbor) && !tilesReached.containsKey(neighbor)){
|
||||||
tilesReached[neighbor] = tileInfo;
|
tilesReached[neighbor] = tileInfo
|
||||||
newTilesToCheck.add(neighbor)
|
newTilesToCheck.add(neighbor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ class MapType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MapGenerator() {
|
class MapGenerator {
|
||||||
|
|
||||||
fun generateMap(gameParameters: GameParameters): TileMap {
|
fun generateMap(gameParameters: GameParameters): TileMap {
|
||||||
val mapRadius = gameParameters.mapRadius
|
val mapRadius = gameParameters.mapRadius
|
||||||
@ -269,7 +269,7 @@ class MapGenerator() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MapLandmassGenerator(){
|
class MapLandmassGenerator {
|
||||||
|
|
||||||
fun generateLandCellularAutomata(tileMap: TileMap, mapRadius: Int, mapType: String) {
|
fun generateLandCellularAutomata(tileMap: TileMap, mapRadius: Int, mapType: String) {
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ class GameParameters { // Default values are the default new game
|
|||||||
var mapType = MapType.pangaea
|
var mapType = MapType.pangaea
|
||||||
var noBarbarians = false
|
var noBarbarians = false
|
||||||
var oneCityChallenge = false
|
var oneCityChallenge = false
|
||||||
var noRuins = false;
|
var noRuins = false
|
||||||
var mapFileName: String? = null
|
var mapFileName: String? = null
|
||||||
var victoryTypes: ArrayList<VictoryType> = VictoryType.values().toCollection(ArrayList()) // By default, all victory types
|
var victoryTypes: ArrayList<VictoryType> = VictoryType.values().toCollection(ArrayList()) // By default, all victory types
|
||||||
var startingEra = TechEra.Ancient
|
var startingEra = TechEra.Ancient
|
||||||
|
@ -55,7 +55,7 @@ class CityScreenCityPickerTable(val cityScreen: CityScreen) : Table(){
|
|||||||
currentCityLabel.onClick {
|
currentCityLabel.onClick {
|
||||||
val editCityNamePopup = PopupTable(cityScreen)
|
val editCityNamePopup = PopupTable(cityScreen)
|
||||||
val textArea = TextField(city.name, CameraStageBaseScreen.skin)
|
val textArea = TextField(city.name, CameraStageBaseScreen.skin)
|
||||||
textArea.setAlignment(Align.center)
|
textArea.alignment = Align.center
|
||||||
editCityNamePopup.add(textArea).colspan(2).row()
|
editCityNamePopup.add(textArea).colspan(2).row()
|
||||||
editCityNamePopup.addCloseButton()
|
editCityNamePopup.addCloseButton()
|
||||||
editCityNamePopup.addButton("Save".tr()){
|
editCityNamePopup.addButton("Save".tr()){
|
||||||
|
@ -101,7 +101,7 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski
|
|||||||
|
|
||||||
if (city.isPuppet) {
|
if (city.isPuppet) {
|
||||||
val puppetImage = ImageGetter.getImage("OtherIcons/Puppet")
|
val puppetImage = ImageGetter.getImage("OtherIcons/Puppet")
|
||||||
puppetImage.setColor(secondaryColor)
|
puppetImage.color = secondaryColor
|
||||||
iconTable.add(puppetImage).size(20f).pad(2f).padLeft(5f)
|
iconTable.add(puppetImage).size(20f).pad(2f).padLeft(5f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo):CameraStageBaseScreen() {
|
|||||||
val ally = otherCiv.getAllyCiv()
|
val ally = otherCiv.getAllyCiv()
|
||||||
if (ally != "")
|
if (ally != "")
|
||||||
{
|
{
|
||||||
diplomacyTable.add(("Ally: ".tr() + ally!!.tr() + " " + "Influence: ".tr()
|
diplomacyTable.add(("Ally: ".tr() + ally.tr() + " " + "Influence: ".tr()
|
||||||
+ otherCiv.getDiplomacyManager(ally).influence.toString().tr()).toLabel()).row()
|
+ otherCiv.getDiplomacyManager(ally).influence.toString().tr()).toLabel()).row()
|
||||||
}
|
}
|
||||||
val nextLevelString: String
|
val nextLevelString: String
|
||||||
|
@ -11,7 +11,7 @@ import java.net.HttpURLConnection
|
|||||||
import java.net.URL
|
import java.net.URL
|
||||||
import java.nio.charset.StandardCharsets
|
import java.nio.charset.StandardCharsets
|
||||||
|
|
||||||
class DropBox(){
|
class DropBox {
|
||||||
|
|
||||||
fun dropboxApi(url:String, data:String="",contentType:String="",dropboxApiArg:String=""): InputStream? {
|
fun dropboxApi(url:String, data:String="",contentType:String="",dropboxApiArg:String=""): InputStream? {
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ class DropBox(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class OnlineMultiplayer(){
|
class OnlineMultiplayer {
|
||||||
fun getGameLocation(gameId:String) = "/MultiplayerGames/$gameId"
|
fun getGameLocation(gameId:String) = "/MultiplayerGames/$gameId"
|
||||||
|
|
||||||
fun tryUploadGame(gameInfo: GameInfo){
|
fun tryUploadGame(gameInfo: GameInfo){
|
||||||
|
@ -16,7 +16,7 @@ import kotlin.concurrent.thread
|
|||||||
class Language(val language:String){
|
class Language(val language:String){
|
||||||
val percentComplete:Int
|
val percentComplete:Int
|
||||||
init{
|
init{
|
||||||
val availableTranslations = GameBasics.Translations.count() { it.value.containsKey(language) }
|
val availableTranslations = GameBasics.Translations.count { it.value.containsKey(language) }
|
||||||
if(language=="English") percentComplete = 100
|
if(language=="English") percentComplete = 100
|
||||||
else percentComplete = (availableTranslations*100 / GameBasics.Translations.size)
|
else percentComplete = (availableTranslations*100 / GameBasics.Translations.size)
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ public class NativeFont extends BitmapFont {
|
|||||||
EmojiDate date = this.emojiSet.get(css);
|
EmojiDate date = this.emojiSet.get(css);
|
||||||
appendEmoji(c2 + "", date.path, date.size);
|
appendEmoji(c2 + "", date.path, date.size);
|
||||||
} else {
|
} else {
|
||||||
putGlyph(c2, this.listener.getFontPixmap(txt, this.paint));
|
putGlyph(c2, listener.getFontPixmap(txt, this.paint));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -265,7 +265,7 @@ public class NativeFont extends BitmapFont {
|
|||||||
|
|
||||||
for (Glyph glyph : page) {
|
for (Glyph glyph : page) {
|
||||||
if (glyph != null) {
|
if (glyph != null) {
|
||||||
TextureRegion region = (TextureRegion) getRegions().get(glyph.page);
|
TextureRegion region = getRegions().get(glyph.page);
|
||||||
if (region == null) {
|
if (region == null) {
|
||||||
throw new IllegalArgumentException("BitmapFont texture region array cannot contain null elements.");
|
throw new IllegalArgumentException("BitmapFont texture region array cannot contain null elements.");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user