From f51923b1f6ce92a784fb9ce1b030ad146ea4b2f9 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Fri, 1 Dec 2017 15:14:18 +0200 Subject: [PATCH] Camelcased json model field names --- android/assets/jsons/BasicHelp.json | 36 +-- android/assets/jsons/Buildings.json | 278 ++++++++--------- android/assets/jsons/Techs.json | 280 +++++++++--------- android/assets/jsons/Terrains.json | 112 +++---- android/assets/jsons/TileImprovements.json | 114 +++---- android/assets/jsons/TileResources.json | 234 +++++++-------- core/src/com/unciv/civinfo/CityBuildings.java | 38 +-- core/src/com/unciv/civinfo/CityInfo.java | 36 +-- .../com/unciv/civinfo/CivilizationInfo.java | 10 +- .../com/unciv/civinfo/CivilizationTech.java | 4 +- core/src/com/unciv/civinfo/TileInfo.java | 32 +- core/src/com/unciv/civinfo/TileMap.java | 19 +- core/src/com/unciv/game/CityScreen.java | 20 +- .../src/com/unciv/game/CivilopediaScreen.java | 2 +- core/src/com/unciv/game/TileGroup.java | 2 +- core/src/com/unciv/game/UnCivGame.java | 14 +- core/src/com/unciv/game/WorldScreen.java | 18 +- .../pickerscreens/BuildingPickerScreen.java | 8 +- .../ImprovementPickerScreen.java | 9 +- .../game/pickerscreens/TechPickerScreen.java | 22 +- .../unciv/models/gamebasics/BasicHelp.java | 6 +- .../com/unciv/models/gamebasics/Building.java | 37 ++- .../unciv/models/gamebasics/ICivilopedia.java | 2 +- .../unciv/models/gamebasics/TechColumn.java | 10 +- .../unciv/models/gamebasics/Technology.java | 12 +- .../com/unciv/models/gamebasics/Terrain.java | 54 ++-- .../unciv/models/gamebasics/TerrainType.java | 6 + .../models/gamebasics/TileImprovement.java | 22 +- .../unciv/models/gamebasics/TileResource.java | 22 +- core/src/com/unciv/models/stats/CivStats.java | 16 +- .../src/com/unciv/models/stats/FullStats.java | 28 +- .../com/unciv/models/stats/NamedStats.java | 6 +- 32 files changed, 750 insertions(+), 759 deletions(-) create mode 100644 core/src/com/unciv/models/gamebasics/TerrainType.java diff --git a/android/assets/jsons/BasicHelp.json b/android/assets/jsons/BasicHelp.json index 3d56c90da2..1b6fc04494 100644 --- a/android/assets/jsons/BasicHelp.json +++ b/android/assets/jsons/BasicHelp.json @@ -1,38 +1,38 @@ [ { - "Name":"City", - "Description": "Your cities are the basis of your empire. Each city has a certain amount of population and many tiles, and can work as many tiles as it has population.\nThe center tile of a city is always worked and does not require population.\nNew Cities can be constructed by building a Settler.\nEach city your empire has removes 3 Happiness from the emmpire, and each population - another 1 Happiness, so plan carefully!" + name:"City", + description: "Your cities are the basis of your empire. Each city has a certain amount of population and many tiles, and can work as many tiles as it has population.\nThe center tile of a city is always worked and does not require population.\nNew Cities can be constructed by building a Settler.\nEach city your empire has removes 3 Happiness from the emmpire, and each population - another 1 Happiness, so plan carefully!" }, { - "Name":"Tile", - "Description": "Tiles are areas where your population can work the land.\nEvery tile has a base terrain, such as Grassland, Tundra etc, and some have terrain overlays, like Hill, Forest etc.\nDepending on the terrain, tiles can hold tile resources.\nEach tile can have one improvement at anny given time." + name:"Tile", + description: "Tiles are areas where your population can work the land.\nEvery tile has a base terrain, such as Grassland, Tundra etc, and some have terrain overlays, like Hill, Forest etc.\nDepending on the terrain, tiles can hold tile resources.\nEach tile can have one improvement at anny given time." }, { - "Name":"Population", - "Description": "Represents the number of people in your city, who can work the city's tiles.\nPopulation grows by having enough surplus food, and will shrink if there isn't enough food to go around.\nEach Population consumes 2 Food per turn.\nWhen a new population is added, it will automatically work the tile producing the most food.\nYou can manually assign population to tiles by clicking the population icon on a tile - you'll have to remove a population from a tile to assign it somewhere else!" + name:"Population", + description: "Represents the number of people in your city, who can work the city's tiles.\nPopulation grows by having enough surplus food, and will shrink if there isn't enough food to go around.\nEach Population consumes 2 Food per turn.\nWhen a new population is added, it will automatically work the tile producing the most food.\nYou can manually assign population to tiles by clicking the population icon on a tile - you'll have to remove a population from a tile to assign it somewhere else!" }, { - "Name":"Basic Resources", - "Description": "There are 6 basic resources in Civ: Food, Production, Gold, Science, Happiness and Culture.\rProduction and Food are per individual city, while the other resources are empire-wide.\rBasic resources are produced by working city tiles and by buildings." + name:"Basic Resources", + description: "There are 6 basic resources in Civ: Food, Production, Gold, Science, Happiness and Culture.\rProduction and Food are per individual city, while the other resources are empire-wide.\rBasic resources are produced by working city tiles and by buildings." }, { - "Name":"Food", - "Description": "A basic resource. Each city can store surplus food.\nWhen the surplus food reaches a certain amount dependant on the population, it is consumed and the city gains another population.\nIf all the suplus food is depleted, and there is a food shortage, the city will lose a population." + name:"Food", + description: "A basic resource. Each city can store surplus food.\nWhen the surplus food reaches a certain amount dependant on the population, it is consumed and the city gains another population.\nIf all the suplus food is depleted, and there is a food shortage, the city will lose a population." }, { - "Name":"Production", - "Description": "A basic resource. Production is used to build buildings and units in the city.\r\nEach idle population (not working a tile) produces 1 production." + name:"Production", + description: "A basic resource. Production is used to build buildings and units in the city.\r\nEach idle population (not working a tile) produces 1 production." }, { - "Name":"Science", - "Description": "A basic resource. Represents the scientific advancement of your empire.\nEach Technology requires a certain amount of Science, which increases as the technologies become more advanced.\nEach Population produces 1 Science." + name:"Science", + description: "A basic resource. Represents the scientific advancement of your empire.\nEach Technology requires a certain amount of Science, which increases as the technologies become more advanced.\nEach Population produces 1 Science." }, { - "Name":"Gold", - "Description": "A basic resource. Represents the wealth of your empire.\nMost buildings have mainainance costs, which require Gold per turn.\nEvery turn you are in a gold deficit, you will lose science points equal to your debt, which can halt your scientific advancement entirely!." + name:"Gold", + description: "A basic resource. Represents the wealth of your empire.\nMost buildings have mainainance costs, which require Gold per turn.\nEvery turn you are in a gold deficit, you will lose science points equal to your debt, which can halt your scientific advancement entirely!." }, { - "Name":"Happiness", - "Description": "A basic resource.\nEach city decreases your empire's happiness by 3, and each population by 1.\nYou can increase your happiness by buildings, or by working Luxury resources.\nWhen in an unhappy state, your surplus food added is reduced to 1/4, dramatically slowing your city growth.\nWhen enough Happiness is accrued, your empire will enter a Golden Age!" + name:"Happiness", + description: "A basic resource.\nEach city decreases your empire's happiness by 3, and each population by 1.\nYou can increase your happiness by buildings, or by working Luxury resources.\nWhen in an unhappy state, your surplus food added is reduced to 1/4, dramatically slowing your city growth.\nWhen enough Happiness is accrued, your empire will enter a Golden Age!" } ] \ No newline at end of file diff --git a/android/assets/jsons/Buildings.json b/android/assets/jsons/Buildings.json index 9647bbb0aa..fbba64e258 100644 --- a/android/assets/jsons/Buildings.json +++ b/android/assets/jsons/Buildings.json @@ -1,194 +1,194 @@ [ { - "Name":"Worker", - "Description": "Can build improvements on tiles", - "Cost":60 + name:"Worker", + description: "Can build improvements on tiles", + cost:60 }, { - "Name":"Settler", - "Description": "Founds a new city", - "Cost":106 + name:"Settler", + description: "Founds a new city", + cost:106 }, { - "Name":"Palace", - "Description": "Indicates that this city is the capital", - "IsWonder":true, - "Production":3, - "Science":3, - "Gold":3, - "Culture":1, - "Cost":1 + name:"Palace", + description: "Indicates that this city is the capital", + isWonder:true, + production:3, + science:3, + gold:3, + culture:1, + cost:1 }, { - "Name":"Monument", - "Description": "Produces culture, enabling border growth", - "Culture":2, - "Cost":40, - "Maintainance":1 + name:"Monument", + description: "Produces culture, enabling border growth", + culture:2, + cost:40, + maintainance:1 }, { - "Name":"Granary", - "Description": "Wheat, bananas and deer produce +1 food.", - "Food":2, - "ResourceBonusStats":{"Food":1}, - "Maintainance":1, - "RequiredTech":"Pottery" + name:"Granary", + description: "Wheat, bananas and deer produce +1 food.", + food:2, + resourceBonusStats:{food:1}, + maintainance:1, + requiredTech:"Pottery" }, { - "Name":"Library", - "Description": "Adds 1 science for each 2 population in the city.", - "Maintainance":1, - "RequiredTech":"Writing" + name:"Library", + description: "Adds 1 science for each 2 population in the city.", + maintainance:1, + requiredTech:"Writing" }, { - "Name":"Great Library", - "Description": "Provides a free technology, and a library in the city it is built in", - "Science":3, - "Culture":1, - "IsWonder":true, - "ProvidesFreeBuilding": "Library", - "FreeTechs":1, - "RequiredTech":"Writing" + name:"Great Library", + description: "Provides a free technology, and a library in the city it is built in", + science:3, + culture:1, + isWonder:true, + providesFreeBuilding: "Library", + freeTechs:1, + requiredTech:"Writing" }, { - "Name":"Temple", - "Description": "", - "Culture":3, - "RequiredBuilding":"Monument", - "Maintainance":2, - "RequiredTech":"Philosophy" + name:"Temple", + description: "", + culture:3, + requiredBuilding:"Monument", + maintainance:2, + requiredTech:"Philosophy" }, { - "Name":"Oracle", - "Description": "Provides a free social policy - todo", - "Culture":3, - "IsWonder":true, - "RequiredTech":"Philosophy" + name:"Oracle", + description: "Provides a free social policy - todo", + culture:3, + isWonder:true, + requiredTech:"Philosophy" }, { - "Name":"National College", - "Description": "+50% science from this city", - "Science":3, - "Culture":1, - "IsWonder":true, - "RequiredBuildingInAllCities":"Library", - "RequiredTech":"Philosophy" + name:"National College", + description: "+50% science from this city", + science:3, + culture:1, + isWonder:true, + requiredBuildingInAllCities:"Library", + requiredTech:"Philosophy" }, { - "Name":"Stable", - "Description": "Cattle, sheep and horses produce +1 production.", - "Maintainance":1, - "ResourceRequired":true, - "ResourceBonusStats":{"Production":1}, - "RequiredTech":"Horseback Riding" + name:"Stable", + description: "Cattle, sheep and horses produce +1 production.", + maintainance:1, + resourceRequired:true, + resourceBonusStats:{production:1}, + requiredTech:"Horseback Riding" }, { - "Name":"Circus Maximus", - "Description": "", - "Happiness":5, - "Culture":1, - "IsWonder":true, - "RequiredBuildingInAllCities":"Colloseum", - "RequiredTech":"Philosophy" + name:"Circus Maximus", + description: "", + happiness:5, + culture:1, + isWonder:true, + requiredBuildingInAllCities:"Colloseum", + requiredTech:"Philosophy" }, { - "Name":"Hanging Gardens", - "Description": "", - "Food":10, - "Culture":1, - "IsWonder":true, - "RequiredTech":"Mathematics" + name:"Hanging Gardens", + description: "", + food:10, + culture:1, + isWonder:true, + requiredTech:"Mathematics" }, { - "Name":"Colloseum", - "Description": "", - "Maintainance":1, - "Happiness":2, - "RequiredTech":"Construction" + name:"Colloseum", + description: "", + maintainance:1, + happiness:2, + requiredTech:"Construction" }, { - "Name":"Market", - "Description": "", - "Gold":2, - "PercentStatBonus":{"Gold":25}, - "RequiredTech":"Currency" + name:"Market", + description: "", + gold:2, + percentStatBonus:{gold:25}, + requiredTech:"Currency" }, { - "Name":"Chichen Itza", - "Description": "Length of golden ages increased +50%", - "Gold":5, - "Culture":1, - "IsWonder":true, - "RequiredTech":"Currency" + name:"Chichen Itza", + description: "Length of golden ages increased +50%", + gold:5, + culture:1, + isWonder:true, + requiredTech:"Currency" }, { - "Name":"Mint", - "Description": "", - "Maintainance":0, - "ResourceRequired":true, - "ResourceBonusStats":{"Gold":2}, - "RequiredTech":"Currency" + name:"Mint", + description: "", + maintainance:0, + resourceRequired:true, + resourceBonusStats:{gold:2}, + requiredTech:"Currency" }, { - "Name":"Machu Pichu", - "Description": "Gold from all trade routes +25%. Can only be built on cities with mountain in range of 2 tiles - todo", - "Gold":5, - "Culture":1, - "IsWonder":true, - "RequiredTech":"Currency" + name:"Machu Pichu", + description: "Gold from all trade routes +25%. Can only be built on cities with mountain in range of 2 tiles - todo", + gold:5, + culture:1, + isWonder:true, + requiredTech:"Currency" }, { - "Name":"Aqueduct", - "Description": "40% of food is carried over after a new citizen is born - TODO", - "Maintainance":1, - "Food":2, - "RequiredTech":"Engineering" + name:"Aqueduct", + description: "40% of food is carried over after a new citizen is born - TODO", + maintainance:1, + food:2, + requiredTech:"Engineering" }, { - "Name":"Workshop", - "Description": "", - "Maintainance":2, - "Production":2, - "PercentStatBonus":{"Production":15}, - "RequiredTech":"Metal Casting" + name:"Workshop", + description: "", + maintainance:2, + production:2, + percentStatBonus:{production:15}, + requiredTech:"Metal Casting" }, { - "Name":"Forge", - "Description": "Iron provides +1 production", - "Maintainance":1, - "ResourceRequired":true, - "ResourceBonusStats":{"Production":1}, - "RequiredTech":"Metal Casting" + name:"Forge", + description: "Iron provides +1 production", + maintainance:1, + resourceRequired:true, + resourceBonusStats:{production:1}, + requiredTech:"Metal Casting" }, { - "Name":"University", - "Description": "Jungles provide +2 science", - "Maintainance":2, - "PercentStatBonus":{"Science":33}, - "RequiredBuilding":"Library", - "RequiredTech":"Metal Casting" + name:"University", + description: "Jungles provide +2 science", + maintainance:2, + percentStatBonus:{science:33}, + requiredBuilding:"Library", + requiredTech:"Metal Casting" }, { - "Name":"Oxford University", - "Description": "+50% science from this city", - "Science":3, - "Culture":1, - "FreeTechs":1, - "IsWonder":true, - "RequiredBuildingInAllCities":"University", - "RequiredTech":"Education" + name:"Oxford University", + description: "+50% science from this city", + science:3, + culture:1, + freeTechs:1, + isWonder:true, + requiredBuildingInAllCities:"University", + requiredTech:"Education" }, { - "Name":"Angkor Wat", - "Description": "Cost of aquiring new tiles reduced by 25% - TODO", - "Culture":1, - "IsWonder":true, - "NewTileCostReduction":25, - "RequiredTech":"Education" + name:"Angkor Wat", + description: "Cost of aquiring new tiles reduced by 25% - TODO", + culture:1, + isWonder:true, + newTileCostReduction:25, + requiredTech:"Education" } ] \ No newline at end of file diff --git a/android/assets/jsons/Techs.json b/android/assets/jsons/Techs.json index a3f61f1b7a..117abf3f7d 100644 --- a/android/assets/jsons/Techs.json +++ b/android/assets/jsons/Techs.json @@ -1,216 +1,216 @@ [ { - "ColumnNumber": 1, - "TechCost": 35, - "BuildingCost":60, - "Techs":[ + columnNumber: 1, + techCost: 35, + buildingCost:60, + techs:[ { - "Name":"Pottery", - "Row":2, - "Description":"Allows your cities to construct a granary, which provides food." + name:"Pottery", + row:2, + description:"Allows your cities to construct a granary, which provides food." }, { - "Name":"Animal Husbandry", - "Row":5, - "Description":"Reveals horses, and allows workers to build pastures, which improve various animal resources." + name:"Animal Husbandry", + row:5, + description:"Reveals horses, and allows workers to build pastures, which improve various animal resources." }, { - "Name":"Mining", - "Row":9, - "Description":"Allows workers to build mines, which grant access to several strategic and luxury resources and increases production. Also allows workers to clear forests." + name:"Mining", + row:9, + description:"Allows workers to build mines, which grant access to several strategic and luxury resources and increases production. Also allows workers to clear forests." } ] }, { - "ColumnNumber": 2, - "TechCost": 55, - "BuildingCost":75, - "WonderCost":185, - "Techs":[ + columnNumber: 2, + techCost: 55, + buildingCost:75, + wonderCost:185, + techs:[ { - "Name":"Sailing", - "Row":1, - "Prerequisites":["Pottery"], - "Description":"Allows access to sea resources by building work boats" + name:"Sailing", + row:1, + prerequisites:["Pottery"], + description:"Allows access to sea resources by building work boats" }, { - "Name":"Calendar", - "Row":2, - "Prerequisites":["Pottery"], - "Description":"Allows your workers to build Plantations, which grant access to several luxury resources" + name:"Calendar", + row:2, + prerequisites:["Pottery"], + description:"Allows your workers to build Plantations, which grant access to several luxury resources" }, { - "Name":"Writing", - "Row":3, - "Prerequisites":["Pottery"], - "Description":"Allows your cities to construct libraries, which increases science produced. Also enables construction of the Great Library wonder." + name:"Writing", + row:3, + prerequisites:["Pottery"], + description:"Allows your cities to construct libraries, which increases science produced. Also enables construction of the Great Library wonder." }, { - "Name":"Trapping", - "Row":5, - "Prerequisites":["Animal Husbandry"], - "Description":"Allows your workers to build Camps and Trading Posts, which increase gold produced and grant access to several luxury resources" + name:"Trapping", + row:5, + prerequisites:["Animal Husbandry"], + description:"Allows your workers to build Camps and Trading Posts, which increase gold produced and grant access to several luxury resources" }, { - "Name":"The Wheel", - "Row":6, - "Prerequisites":["Animal Husbandry"], - "Description":"Allows construction or roads to your capilat city, providing gold from trade" + name:"The Wheel", + row:6, + prerequisites:["Animal Husbandry"], + description:"Allows construction or roads to your capilat city, providing gold from trade" }, { - "Name":"Masonry", - "Row":9, - "Prerequisites":["Mining"], - "Description":"Allows workers to build quarries, granting access to stone and marble resources, and clear marshes. Also enables construction of the Pyramids wonder." + name:"Masonry", + row:9, + prerequisites:["Mining"], + description:"Allows workers to build quarries, granting access to stone and marble resources, and clear marshes. Also enables construction of the Pyramids wonder." }, { - "Name":"Bronze Working", - "Row":10, - "Prerequisites":["Mining"], - "Description":"Allows workers to remove jungles" + name:"Bronze Working", + row:10, + prerequisites:["Mining"], + description:"Allows workers to remove jungles" } ] }, { - "ColumnNumber": 3, - "TechCost": 115, - "BuildingCost":100, - "WonderCost":250, - "Techs":[ + columnNumber: 3, + techCost: 115, + buildingCost:100, + wonderCost:250, + techs:[ { - "Name":"Optics", - "Cost":95, - "Row":1, - "Prerequisites":["Sailing"], - "Description":"Allows construction of lighthouses, providing more food for sea tiles" + name:"Optics", + cost:95, + row:1, + prerequisites:["Sailing"], + description:"Allows construction of lighthouses, providing more food for sea tiles" }, { - "Name":"Philosophy", - "Row":3, - "Prerequisites":["Writing"], - "Description":"Allows construction of temples, which generate culture, and the Oracle and National College wonders" + name:"Philosophy", + row:3, + prerequisites:["Writing"], + description:"Allows construction of temples, which generate culture, and the Oracle and National College wonders" }, { - "Name":"Horseback Riding", - "Row":5, - "Prerequisites":["The Wheel"], - "Description":"Allows construction of stables, which increase production on cattle, sheep and horses" + name:"Horseback Riding", + row:5, + prerequisites:["The Wheel"], + description:"Allows construction of stables, which increase production on cattle, sheep and horses" }, { - "Name":"Mathematics", - "Row":7, - "Prerequisites":["The Wheel"], - "Description": "Enables construction of the Hanging Gardens wonder." + name:"Mathematics", + row:7, + prerequisites:["The Wheel"], + description: "Enables construction of the Hanging Gardens wonder." }, { - "Name":"Construction", - "Row":9, - "Prerequisites":["Masonry"], - "Description":"Allows construction of colloseums, which generate happiness, and building lumber mills on forests, providing production" + name:"Construction", + row:9, + prerequisites:["Masonry"], + description:"Allows construction of colloseums, which generate happiness, and building lumber mills on forests, providing production" }, { - "Name":"Iron Working", - "Row":10, - "Prerequisites":["Bronze Working"], - "Description":"Reveals Iron on map" + name:"Iron Working", + row:10, + prerequisites:["Bronze Working"], + description:"Reveals Iron on map" } ] }, { - "ColumnNumber": 4, - "TechCost": 305, - "BuildingCost":120, - "WonderCost":300, - "Techs":[ + columnNumber: 4, + techCost: 305, + buildingCost:120, + wonderCost:300, + techs:[ { - "Name":"Theology", - "Row":2, - "Prerequisites":["Calendar","Philosophy"], - "Description":"???" + name:"Theology", + row:2, + prerequisites:["Calendar","Philosophy"], + description:"???" }, { - "Name":"Civil Service", - "Row":4, - "Prerequisites":["Trapping","Philosophy"], - "Description":"Enables the Chichen Itza wonder, which increases the length of golden ages" + name:"Civil Service", + row:4, + prerequisites:["Trapping","Philosophy"], + description:"Enables the Chichen Itza wonder, which increases the length of golden ages" }, { - "Name":"Currency", - "Row":7, - "Prerequisites":["Mathematics"], - "Description":"Enables construction of Markets and Mints, which increase gold. Also enables the Machu Pichu wonder." + name:"Currency", + row:7, + prerequisites:["Mathematics"], + description:"Enables construction of Markets and Mints, which increase gold. Also enables the Machu Pichu wonder." }, { - "Name":"Engineering", - "Row":8, - "Prerequisites":["Mathematics","Construction"], - "Description":"Enables construction of aqueducts, which speed up city growth" + name:"Engineering", + row:8, + prerequisites:["Mathematics","Construction"], + description:"Enables construction of aqueducts, which speed up city growth" }, { - "Name":"Metal Casting", - "Row":10, - "Prerequisites":["Construction","Iron Working"], - "Description":"Enables constrution of Forges and Workshops, increasing production" + name:"Metal Casting", + row:10, + prerequisites:["Construction","Iron Working"], + description:"Enables constrution of Forges and Workshops, increasing production" } ] }, { - "ColumnNumber": 5, - "TechCost": 535, - "BuildingCost":160, - "WonderCost":400, - "Techs":[ + columnNumber: 5, + techCost: 535, + buildingCost:160, + wonderCost:400, + techs:[ { - "Name":"Compass", - "Row":1, - "Cost":415, - "Prerequisites":["Optics"], - "Description":"???" + name:"Compass", + row:1, + cost:415, + prerequisites:["Optics"], + description:"???" }, { - "Name":"Education", - "Row":3, - "Prerequisites":["Theology","Civil Service"], - "Description":"Allows cities to convert production to science, construction of Universities which provide science, and construction of the Angkor Wat wonder" + name:"Education", + row:3, + prerequisites:["Theology","Civil Service"], + description:"Allows cities to convert production to science, construction of Universities which provide science, and construction of the Angkor Wat wonder" }, { - "Name":"Chivalry", - "Row":5, - "Prerequisites":["Horseback Riding","Civil Service","Currency"], - "Description":"???" + name:"Chivalry", + row:5, + prerequisites:["Horseback Riding","Civil Service","Currency"], + description:"???" }, { - "Name":"Machinery", - "Row":8, - "Prerequisites":["Engineering"], - "Description":"???" + name:"Machinery", + row:8, + prerequisites:["Engineering"], + description:"???" }, { - "Name":"Physics", - "Row":9, - "Prerequisites":["Engineering","Metal Casting"], - "Description":"???" + name:"Physics", + row:9, + prerequisites:["Engineering","Metal Casting"], + description:"???" }, { - "Name":"Steel", - "Row":10, - "Prerequisites":["Metal Casting"], - "Description":"???" + name:"Steel", + row:10, + prerequisites:["Metal Casting"], + description:"???" } ] }, { - "ColumnNumber": 6, - "TechCost": 1265, - "BuildingCost":250, - "WonderCost":625, - "Techs":[ + columnNumber: 6, + techCost: 1265, + buildingCost:250, + wonderCost:625, + techs:[ { - "Name":"Economics", - "Row":1, - "Prerequisites":["Chivalry"], - "Description":"This is a lie, change!!!" + name:"Economics", + row:1, + prerequisites:["Chivalry"], + description:"This is a lie, change!!!" } ] } diff --git a/android/assets/jsons/Terrains.json b/android/assets/jsons/Terrains.json index e6f9136831..6875778d15 100644 --- a/android/assets/jsons/Terrains.json +++ b/android/assets/jsons/Terrains.json @@ -1,82 +1,82 @@ [ { - "Name":"Grassland", - "Type":"BaseTerrain", - "Food":2, - "RGB":"0,255,0" + name:"Grassland", + type:"BaseTerrain", + food:2, + rgb:"0,255,0" }, { - "Name":"Plains", - "Type":"BaseTerrain", - "Food":1, - "Production":1, - "RGB":"240,180,135" + name:"Plains", + type:"BaseTerrain", + food:1, + production:1, + rgb:"240,180,135" }, { - "Name":"Tundra", - "Type":"BaseTerrain", - "Food":1, - "RGB":"130,137,121" + name:"Tundra", + type:"BaseTerrain", + food:1, + rgb:"130,137,121" }, { - "Name":"Desert", - "Type":"BaseTerrain", - "RGB":"237,201,175" + name:"Desert", + type:"BaseTerrain", + rgb:"237,201,175" }, { - "Name":"Lakes", - "Type":"BaseTerrain", - "Food":1, - "Gold":1, - "RGB":"104,120,201", - "CanHaveOverlay":false + name:"Lakes", + type:"BaseTerrain", + food:1, + gold:1, + rgb:"104,120,201", + canHaveOverlay:false }, { - "Name":"Hill", - "Type":"BaseTerrain", - "Production":2, - "RGB":"116,88,62" + name:"Hill", + type:"BaseTerrain", + production:2, + rgb:"116,88,62" }, { - "Name":"Forest", - "Type":"TerrainFeature", - "Production":1, - "Food":1, - "OverrideStats":true, - "Unbuildable":true, - "OccursOn":["Tundra","Plains","Grassland"], - "RemovalTech": "Mining" + name:"Forest", + type:"TerrainFeature", + production:1, + food:1, + overrideStats:true, + unbuildable:true, + occursOn:["Tundra","Plains","Grassland"], + removalTech: "Mining" }, { - "Name":"Jungle", - "Type":"TerrainFeature", - "Food":2, - "OverrideStats":true, - "Unbuildable":true, - "OccursOn":["Plains","Grassland"], - "RemovalTech": "Bronze Working" + name:"Jungle", + type:"TerrainFeature", + food:2, + overrideStats:true, + unbuildable:true, + occursOn:["Plains","Grassland"], + removalTech: "Bronze Working" }, { - "Name":"Marsh", - "Type":"TerrainFeature", - "Food":-1, - "Unbuildable":true, - "OccursOn":["Grassland"], - "RemovalTech": "Masonry" + name:"Marsh", + type:"TerrainFeature", + food:-1, + unbuildable:true, + occursOn:["Grassland"], + removalTech: "Masonry" }, { - "Name":"Oasis", - "Type":"TerrainFeature", - "Food":3, - "Unbuildable":true, - "OccursOn":["Desert"] + name:"Oasis", + type:"TerrainFeature", + food:3, + unbuildable:true, + occursOn:["Desert"] }, { - "Name":"Flood plains", - "Type":"TerrainFeature", - "Food":2, - "OccursOn":["Desert"] + name:"Flood plains", + type:"TerrainFeature", + food:2, + occursOn:["Desert"] } ] \ No newline at end of file diff --git a/android/assets/jsons/TileImprovements.json b/android/assets/jsons/TileImprovements.json index 933ebfe8cf..5ce6c0630c 100644 --- a/android/assets/jsons/TileImprovements.json +++ b/android/assets/jsons/TileImprovements.json @@ -1,81 +1,81 @@ [ { - "Name":"Farm", - "TerrainsCanBeBuiltOn":["Plains","Grassland","Desert","Food plains"], - "Food":1, - "TurnsToBuild":6, - "ImprovingTech":"Fertilizer", - "ImprovingTechStats":{"Food":1} + name:"Farm", + terrainsCanBeBuiltOn:["Plains","Grassland","Desert","Food plains"], + food:1, + turnsToBuild:6, + improvingTech:"Fertilizer", + improvingTechStats:{food:1} }, { - "Name":"Lumber mill", - "TerrainsCanBeBuiltOn":["Forest"], - "Production":1, - "TurnsToBuild":6, - "TechRequired":"Construction", - "ImprovingTech":"Scientific Theory", - "ImprovingTechStats":{"Production":1} + name:"Lumber mill", + terrainsCanBeBuiltOn:["Forest"], + production:1, + turnsToBuild:6, + techRequired:"Construction", + improvingTech:"Scientific Theory", + improvingTechStats:{production:1} }, { - "Name":"Mine", - "TerrainsCanBeBuiltOn":["Hill"], - "Production":1, - "TurnsToBuild":6, - "TechRequired":"Mining", - "ImprovingTech":"Chemistry", - "ImprovingTechStats":{"Production":1} + name:"Mine", + terrainsCanBeBuiltOn:["Hill"], + production:1, + turnsToBuild:6, + techRequired:"Mining", + improvingTech:"Chemistry", + improvingTechStats:{production:1} }, { - "Name":"Trading post", - "TerrainsCanBeBuiltOn":["Plains","Grassland","Desert","Hill","Tundra","Forest","Jungle","Food plains"], - "Gold":1, - "TurnsToBuild":6, - "TechRequired":"Trapping", - "ImprovingTech":"Economics", - "ImprovingTechStats": {"Gold":1} + name:"Trading post", + terrainsCanBeBuiltOn:["Plains","Grassland","Desert","Hill","Tundra","Forest","Jungle","Food plains"], + gold:1, + turnsToBuild:6, + techRequired:"Trapping", + improvingTech:"Economics", + improvingTechStats: {gold:1} }, { - "Name":"Camp", - "TurnsToBuild":6, - "TechRequired":"Trapping", - "ImprovingTech":"Economics", - "ImprovingTechStats":{"Gold":1} + name:"Camp", + turnsToBuild:6, + techRequired:"Trapping", + improvingTech:"Economics", + improvingTechStats:{gold:1} }, { - "Name":"Oil well", - "Production":3, - "TurnsToBuild":6 + name:"Oil well", + production:3, + turnsToBuild:6 }, { - "Name":"Pasture", - "TurnsToBuild":6, - "TechRequired":"Animal Husbandry", - "ImprovingTech":"Fertilizer", - "ImprovingTechStats":{"Food":1} + name:"Pasture", + turnsToBuild:6, + techRequired:"Animal Husbandry", + improvingTech:"Fertilizer", + improvingTechStats:{food:1} }, { - "Name":"Plantation", - "TurnsToBuild":6, - "Gold":1, - "TechRequired":"Calendar", - "ImprovingTech":"Fertilizer", - "ImprovingTechStats":{"Food":1} + name:"Plantation", + turnsToBuild:6, + gold:1, + techRequired:"Calendar", + improvingTech:"Fertilizer", + improvingTechStats:{food:1} }, { - "Name":"Quarry", - "TurnsToBuild":6, - "TechRequired":"Masonry", - "ImprovingTech":"Chemistry", - "ImprovingTechStats":{"Production":1} + name:"Quarry", + turnsToBuild:6, + techRequired:"Masonry", + improvingTech:"Chemistry", + improvingTechStats:{production:1} }, { - "Name":"Road", - "TurnsToBuild":6, - "TechRequired":"The Wheel" + name:"Road", + turnsToBuild:6, + techRequired:"The Wheel" }, { - "Name":"Railroad", - "TurnsToBuild":12, - "TechRequired":"Railroad" + name:"Railroad", + turnsToBuild:12, + techRequired:"Railroad" } ] \ No newline at end of file diff --git a/android/assets/jsons/TileResources.json b/android/assets/jsons/TileResources.json index c7636c2f0b..e096de19b1 100644 --- a/android/assets/jsons/TileResources.json +++ b/android/assets/jsons/TileResources.json @@ -1,157 +1,157 @@ [ { - "Name":"Cattle", - "ResourceType":"Bonus", - "TerrainsCanBeFoundOn":["Grassland"], - "Food":1, - "Improvement":"Pasture", - "ImprovementStats":{"Production":1}, - "Building":"Stable" + name:"Cattle", + resourceType:"Bonus", + terrainsCanBeFoundOn:["Grassland"], + food:1, + improvement:"Pasture", + improvementStats:{production:1}, + building:"Stable" }, { - "Name":"Sheep", - "ResourceType":"Bonus", - "TerrainsCanBeFoundOn":["Plains","Hill"], - "Food":1, - "Improvement":"Pasture", - "ImprovementStats":{"Food":1}, - "Building":"Stable" + name:"Sheep", + resourceType:"Bonus", + terrainsCanBeFoundOn:["Plains","Hill"], + food:1, + improvement:"Pasture", + improvementStats:{food:1}, + building:"Stable" }, { - "Name":"Deer", - "ResourceType":"Bonus", - "TerrainsCanBeFoundOn":["Forest","Tundra"], - "Food":1, - "Improvement":"Camp", - "ImprovementStats":{"Production":1}, - "Building":"Granary" + name:"Deer", + resourceType:"Bonus", + terrainsCanBeFoundOn:["Forest","Tundra"], + food:1, + improvement:"Camp", + improvementStats:{production:1}, + building:"Granary" }, { - "Name":"Bananas", - "ResourceType":"Bonus", - "TerrainsCanBeFoundOn":["Jungle"], - "Food":1, - "Improvement":"Plantation", - "ImprovementStats":{"Food":2,"Production":-1}, - "Building":"Granary" + name:"Bananas", + resourceType:"Bonus", + terrainsCanBeFoundOn:["Jungle"], + food:1, + improvement:"Plantation", + improvementStats:{food:2,production:-1}, + building:"Granary" }, { - "Name":"Wheat", - "ResourceType":"Bonus", - "TerrainsCanBeFoundOn":["Plains","Flood plains","Desert"], - "Food":1, - "Improvement":"Farm", - "ImprovementStats":{"Food":1}, - "Building":"Granary" + name:"Wheat", + resourceType:"Bonus", + terrainsCanBeFoundOn:["Plains","Flood plains","Desert"], + food:1, + improvement:"Farm", + improvementStats:{food:1}, + building:"Granary" }, { - "Name":"Stone", - "ResourceType":"Bonus", - "TerrainsCanBeFoundOn":["Plains","Desert"], - "Production":1, - "Improvement":"Quarry", - "ImprovementStats":{"Production":1}, - "Building":"Stone Works" + name:"Stone", + resourceType:"Bonus", + terrainsCanBeFoundOn:["Plains","Desert"], + production:1, + improvement:"Quarry", + improvementStats:{production:1}, + building:"Stone Works" }, { - "Name":"Horses", - "ResourceType":"Strategic", - "RevealedBy":"Animal Husbandry", - "TerrainsCanBeFoundOn":["Plains","Desert"], - "Production":1, - "Improvement":"Pasture", - "ImprovementStats":{"Production":1}, - "Building":"Stable" + name:"Horses", + resourceType:"Strategic", + revealedBy:"Animal Husbandry", + terrainsCanBeFoundOn:["Plains","Desert"], + production:1, + improvement:"Pasture", + improvementStats:{production:1}, + building:"Stable" }, { - "Name":"Iron", - "ResourceType":"Strategic", - "RevealedBy":"Iron Working", - "TerrainsCanBeFoundOn":["Grassland","Plains","Desert","Tundra","Snow","Hill"], - "Production":1, - "Improvement":"Mine", - "ImprovementStats":{"Production":1}, - "Building":"Forge" + name:"Iron", + resourceType:"Strategic", + revealedBy:"Iron Working", + terrainsCanBeFoundOn:["Grassland","Plains","Desert","Tundra","Snow","Hill"], + production:1, + improvement:"Mine", + improvementStats:{production:1}, + building:"Forge" }, { - "Name":"Coal", - "ResourceType":"Strategic", - "RevealedBy":"Industrialization", - "TerrainsCanBeFoundOn":["Grassland","Plains","Hill"], - "Production":1, - "Improvement":"Mine", - "ImprovementStats":{"Production":2} + name:"Coal", + resourceType:"Strategic", + revealedBy:"Industrialization", + terrainsCanBeFoundOn:["Grassland","Plains","Hill"], + production:1, + improvement:"Mine", + improvementStats:{production:2} }, { - "Name":"Oil", - "ResourceType":"Strategic", - "RevealedBy":"Biology", - "TerrainsCanBeFoundOn":["Desert","Coast","Tundra","Snow","Marsh"], - "Production":1, - "Improvement":"Oil well", - "ImprovementStats":{"Production":3} + name:"Oil", + resourceType:"Strategic", + revealedBy:"Biology", + terrainsCanBeFoundOn:["Desert","Coast","Tundra","Snow","Marsh"], + production:1, + improvement:"Oil well", + improvementStats:{production:3} }, { - "Name":"Aluminum", - "ResourceType":"Strategic", - "RevealedBy":"Electricity", - "TerrainsCanBeFoundOn":["Plains","Desert","Tundra","Hill"], - "Production":1, - "Improvement":"Mine", - "ImprovementStats":{"Production":2} + name:"Aluminum", + resourceType:"Strategic", + revealedBy:"Electricity", + terrainsCanBeFoundOn:["Plains","Desert","Tundra","Hill"], + production:1, + improvement:"Mine", + improvementStats:{production:2} }, { - "Name":"Uranium", - "ResourceType":"Strategic", - "RevealedBy":"Atomic Theory", - "TerrainsCanBeFoundOn":["Plains","Desert","Tundra","Hill","Snow"], - "Production":1, - "Improvement":"Mine", - "ImprovementStats":{"Production":2} + name:"Uranium", + resourceType:"Strategic", + revealedBy:"Atomic Theory", + terrainsCanBeFoundOn:["Plains","Desert","Tundra","Hill","Snow"], + production:1, + improvement:"Mine", + improvementStats:{production:2} }, { - "Name":"Furs", - "ResourceType":"Luxury", - "TerrainsCanBeFoundOn":["Forest","Tundra"], - "Gold":2, - "Improvement":"Camp", - "ImprovementStats":{"Gold":1} + name:"Furs", + resourceType:"Luxury", + terrainsCanBeFoundOn:["Forest","Tundra"], + gold:2, + improvement:"Camp", + improvementStats:{gold:1} }, { - "Name":"Cotton", - "ResourceType":"Luxury", - "TerrainsCanBeFoundOn":["Grassland","Plains","Desert"], - "Gold":2, - "Improvement":"Plantation", - "ImprovementStats":{"Gold":1} + name:"Cotton", + resourceType:"Luxury", + terrainsCanBeFoundOn:["Grassland","Plains","Desert"], + gold:2, + improvement:"Plantation", + improvementStats:{gold:1} }, { - "Name":"Spices", - "ResourceType":"Luxury", - "TerrainsCanBeFoundOn":["Jungle","Forest"], - "Gold":2, - "Improvement":"Plantation", - "ImprovementStats":{"Gold":1} + name:"Spices", + resourceType:"Luxury", + terrainsCanBeFoundOn:["Jungle","Forest"], + gold:2, + improvement:"Plantation", + improvementStats:{gold:1} }, { - "Name":"Sugar", - "ResourceType":"Luxury", - "TerrainsCanBeFoundOn":["Plains","Flood plains","Grassland","Marsh"], - "Gold":2, - "Improvement":"Plantation", - "ImprovementStats":{"Gold":1} + name:"Sugar", + resourceType:"Luxury", + terrainsCanBeFoundOn:["Plains","Flood plains","Grassland","Marsh"], + gold:2, + improvement:"Plantation", + improvementStats:{gold:1} }, { - "Name":"Marble", - "ResourceType":"Luxury", - "TerrainsCanBeFoundOn":["Desert","Plains","Tundra","Hill","Grassland"], - "Gold":2, - "Improvement":"Quarry", - "ImprovementStats":{"Gold":1,"Production":1}, - "Building":"Stone Works" + name:"Marble", + resourceType:"Luxury", + terrainsCanBeFoundOn:["Desert","Plains","Tundra","Hill","Grassland"], + gold:2, + improvement:"Quarry", + improvementStats:{gold:1,production:1}, + building:"Stone Works" } ] \ No newline at end of file diff --git a/core/src/com/unciv/civinfo/CityBuildings.java b/core/src/com/unciv/civinfo/CityBuildings.java index 6cfed7d1be..20f0e8da71 100644 --- a/core/src/com/unciv/civinfo/CityBuildings.java +++ b/core/src/com/unciv/civinfo/CityBuildings.java @@ -47,7 +47,7 @@ public class CityBuildings if (!InProgressBuildings.containsKey(CurrentBuilding)) InProgressBuildings.put(CurrentBuilding, 0); InProgressBuildings.put(CurrentBuilding, InProgressBuildings.get(CurrentBuilding) + ProductionProduced); - if (InProgressBuildings.get(CurrentBuilding) >= GetGameBuilding(CurrentBuilding).Cost) + if (InProgressBuildings.get(CurrentBuilding) >= GetGameBuilding(CurrentBuilding).cost) { if (CurrentBuilding.equals(Worker) || CurrentBuilding.equals(Settler)) UnCivGame.Current.civInfo.tileMap.get(cityLocation).unit = new Unit(CurrentBuilding,2); @@ -56,9 +56,9 @@ public class CityBuildings { BuiltBuildings.add(CurrentBuilding); Building gameBuilding = GetGameBuilding(CurrentBuilding); - if (gameBuilding.ProvidesFreeBuilding != null && !BuiltBuildings.contains(gameBuilding.ProvidesFreeBuilding)) - BuiltBuildings.add(gameBuilding.ProvidesFreeBuilding); - if (gameBuilding.FreeTechs != 0) UnCivGame.Current.civInfo.tech.FreeTechs += gameBuilding.FreeTechs; + if (gameBuilding.providesFreeBuilding != null && !BuiltBuildings.contains(gameBuilding.providesFreeBuilding)) + BuiltBuildings.add(gameBuilding.providesFreeBuilding); + if (gameBuilding.freeTechs != 0) UnCivGame.Current.civInfo.tech.FreeTechs += gameBuilding.freeTechs; } InProgressBuildings.remove(CurrentBuilding); @@ -79,36 +79,36 @@ public class CityBuildings public boolean CanBuild(final Building building) { CivilizationInfo civInfo = UnCivGame.Current.civInfo; - if(IsBuilt(building.Name)) return false; + if(IsBuilt(building.name)) return false; // if (building.name.equals("Worker") || building.name.equals("Settler")) return false; - if(building.ResourceRequired) { + if(building.resourceRequired) { boolean containsResourceWithImprovement = GetCity().getTilesInRange() .any(new Predicate() { @Override public boolean evaluate(TileInfo tile) { return tile.resource != null - && building.Name.equals(tile.getTileResource().Building) - && tile.getTileResource().Improvement.equals(tile.improvement); + && building.name.equals(tile.getTileResource().building) + && tile.getTileResource().improvement.equals(tile.improvement); } }); if(!containsResourceWithImprovement) return false; } - if (building.RequiredTech != null && !civInfo.tech.IsResearched(building.RequiredTech)) return false; - if (building.IsWonder && civInfo.cities + if (building.requiredTech != null && !civInfo.tech.IsResearched(building.requiredTech)) return false; + if (building.isWonder && civInfo.cities .any(new Predicate() { @Override public boolean evaluate(CityInfo arg0) { CityBuildings CB = arg0.cityBuildings; - return CB.IsBuilding(building.Name) || CB.IsBuilt(building.Name); + return CB.IsBuilding(building.name) || CB.IsBuilt(building.name); } }) ) return false; - if (building.RequiredBuilding != null && !IsBuilt(building.RequiredBuilding)) return false; - if (building.RequiredBuildingInAllCities != null || + if (building.requiredBuilding != null && !IsBuilt(building.requiredBuilding)) return false; + if (building.requiredBuildingInAllCities != null || civInfo.cities.any(new Predicate() { @Override public boolean evaluate(CityInfo arg0) { - return arg0.cityBuildings.IsBuilt(building.RequiredBuildingInAllCities); + return arg0.cityBuildings.IsBuilt(building.requiredBuildingInAllCities); } }) ) return false; @@ -125,7 +125,7 @@ public class CityBuildings .select(new com.unciv.models.LinqCollection.Func() { @Override public String GetBy(Building arg0) { - return arg0.Name; + return arg0.name; } }); } @@ -138,7 +138,7 @@ public class CityBuildings Building gameBuilding = GetGameBuilding(building); stats.add(gameBuilding); //if (gameBuilding.GetFlatBonusStats != null) stats.add(gameBuilding.GetFlatBonusStats(cityInfo)); - stats.Gold -= gameBuilding.Maintainance; + stats.gold -= gameBuilding.maintainance; } return stats; } @@ -147,11 +147,11 @@ public class CityBuildings { int workDone = 0; if (InProgressBuildings.containsKey(buildingName)) workDone = InProgressBuildings.get(buildingName); - float workLeft = GetGameBuilding(buildingName).Cost - workDone; // needs to be float so that we get the cieling properly ;) + float workLeft = GetGameBuilding(buildingName).cost - workDone; // needs to be float so that we get the cieling properly ;) FullStats cityStats = GetCity().getCityStats(); - int production = cityStats.Production; - if (buildingName.equals(Settler)) production += cityStats.Food; + int production = cityStats.production; + if (buildingName.equals(Settler)) production += cityStats.food; return (int) Math.ceil(workLeft / production); } diff --git a/core/src/com/unciv/civinfo/CityInfo.java b/core/src/com/unciv/civinfo/CityInfo.java index 377d4fe7c3..276877bbd3 100644 --- a/core/src/com/unciv/civinfo/CityInfo.java +++ b/core/src/com/unciv/civinfo/CityInfo.java @@ -66,7 +66,7 @@ public class CityInfo { ArrayList LuxuryResources = new ArrayList(); for (TileInfo tileInfo : getTilesInRange()) { TileResource resource = tileInfo.getTileResource(); - if (resource != null && resource.ResourceType == ResourceType.Luxury && resource.Improvement.equals(tileInfo.improvement)) + if (resource != null && resource.resourceType == ResourceType.Luxury && resource.improvement.equals(tileInfo.improvement)) LuxuryResources.add(tileInfo.resource); } return LuxuryResources; @@ -92,10 +92,10 @@ public class CityInfo { public FullStats getCityStats() { FullStats stats = new FullStats() {{ - Happiness = -3 - cityPopulation.Population; // -3 happiness per city and -3 per population + happiness = -3 - cityPopulation.Population; // -3 happiness per city and -3 per population }}; - stats.Science += cityPopulation.Population; + stats.science += cityPopulation.Population; // Working ppl for (TileInfo cell : getTilesInRange()) @@ -103,8 +103,8 @@ public class CityInfo { stats.add(cell.getTileStats()); //idle ppl - stats.Production += getFreePopulation(); - stats.Food -= cityPopulation.Population * 2; + stats.production += getFreePopulation(); + stats.food -= cityPopulation.Population * 2; stats.add(cityBuildings.GetStats()); @@ -114,16 +114,16 @@ public class CityInfo { void nextTurn() { FullStats stats = getCityStats(); - if (cityBuildings.CurrentBuilding.equals(CityBuildings.Settler) && stats.Food > 0) { - stats.Production += stats.Food; - stats.Food = 0; + if (cityBuildings.CurrentBuilding.equals(CityBuildings.Settler) && stats.food > 0) { + stats.production += stats.food; + stats.food = 0; } - if (cityPopulation.NextTurn(stats.Food)) autoAssignWorker(); + if (cityPopulation.NextTurn(stats.food)) autoAssignWorker(); - cityBuildings.NextTurn(stats.Production); + cityBuildings.NextTurn(stats.production); - cultureStored+=stats.Culture; + cultureStored+=stats.culture; if(cultureStored>=getCultureToNextTile()){ addNewTile(); } @@ -165,7 +165,7 @@ public class CityInfo { if (tileInfo.workingCity !=null) continue; FullStats stats = tileInfo.getTileStats(); - double value = stats.Food + stats.Production * 0.5; + double value = stats.food + stats.production * 0.5; if (value > maxValue) { maxValue = value; toWork = tileInfo; @@ -177,12 +177,12 @@ public class CityInfo { private double rankTile(TileInfo tile){ FullStats stats = tile.getTileStats(); double rank=0; - if(stats.Food<2) rank+=stats.Food; - else rank += 2 + (stats.Food-2)/2; // 1 point for each food up to 2, from there on half a point - rank+=stats.Gold/2; - rank+=stats.Production; - rank+=stats.Science; - rank+=stats.Culture; + if(stats.food <2) rank+=stats.food; + else rank += 2 + (stats.food -2)/2; // 1 point for each food up to 2, from there on half a point + rank+=stats.gold /2; + rank+=stats.production; + rank+=stats.science; + rank+=stats.culture; if(tile.improvement ==null) rank+=0.5; // improvement potential! return rank; } diff --git a/core/src/com/unciv/civinfo/CivilizationInfo.java b/core/src/com/unciv/civinfo/CivilizationInfo.java index 462b3bd4e1..9a5c2b4075 100644 --- a/core/src/com/unciv/civinfo/CivilizationInfo.java +++ b/core/src/com/unciv/civinfo/CivilizationInfo.java @@ -34,8 +34,8 @@ public class CivilizationInfo { public CityInfo getCurrentCity() { return cities.get(currentCity); } public int turnsToTech(String TechName) { - return (int) Math.ceil((float)(GameBasics.Technologies.get(TechName).Cost - tech.ResearchOfTech(TechName)) - / getStatsForNextTurn().Science); + return (int) Math.ceil((float)(GameBasics.Technologies.get(TechName).cost - tech.ResearchOfTech(TechName)) + / getStatsForNextTurn().science); } public void addCity(Vector2 location){ @@ -47,7 +47,7 @@ public class CivilizationInfo { { CivStats nextTurnStats = getStatsForNextTurn(); civStats.add(nextTurnStats); - if(cities.size() > 0) tech.NextTurn(nextTurnStats.Science); + if(cities.size() > 0) tech.NextTurn(nextTurnStats.science); for (CityInfo city : cities) city.nextTurn(); @@ -58,14 +58,14 @@ public class CivilizationInfo { public CivStats getStatsForNextTurn() { CivStats statsForTurn = new CivStats() {{ - Happiness = baseHappiness; + happiness = baseHappiness; }}; HashSet LuxuryResources = new HashSet(); for (CityInfo city : cities) { statsForTurn.add(city.getCityStats()); LuxuryResources.addAll(city.getLuxuryResources()); } - statsForTurn.Happiness += LuxuryResources.size() * 5; // 5 happiness for each unique luxury in civ + statsForTurn.happiness += LuxuryResources.size() * 5; // 5 happiness for each unique luxury in civ return statsForTurn; } diff --git a/core/src/com/unciv/civinfo/CivilizationTech.java b/core/src/com/unciv/civinfo/CivilizationTech.java index a52b44b6a1..fa0e4bead8 100644 --- a/core/src/com/unciv/civinfo/CivilizationTech.java +++ b/core/src/com/unciv/civinfo/CivilizationTech.java @@ -32,7 +32,7 @@ public class CivilizationTech{ } public boolean CanBeResearched(String TechName) { - for (String prerequisiteTech : GameBasics.Technologies.get(TechName).Prerequisites) + for (String prerequisiteTech : GameBasics.Technologies.get(TechName).prerequisites) if (!IsResearched(prerequisiteTech)) return false; return true; } @@ -44,7 +44,7 @@ public class CivilizationTech{ if (!TechsInProgress.containsKey(CurrentTechnology)) TechsInProgress.put(CurrentTechnology, 0); TechsInProgress.put(CurrentTechnology, TechsInProgress.get(CurrentTechnology) + scienceForNewTurn); - if (TechsInProgress.get(CurrentTechnology) >= GetCurrentTechnology().Cost) // We finished it! + if (TechsInProgress.get(CurrentTechnology) >= GetCurrentTechnology().cost) // We finished it! { TechsInProgress.remove(CurrentTechnology); TechsResearched.add(CurrentTechnology); diff --git a/core/src/com/unciv/civinfo/TileInfo.java b/core/src/com/unciv/civinfo/TileInfo.java index 6e5a54a4b2..54d6814c56 100644 --- a/core/src/com/unciv/civinfo/TileInfo.java +++ b/core/src/com/unciv/civinfo/TileInfo.java @@ -60,7 +60,7 @@ public class TileInfo if(terrainFeature !=null){ Terrain terrainFeature = getTerrainFeature(); - if(terrainFeature.OverrideStats) stats = new FullStats(terrainFeature); + if(terrainFeature.overrideStats) stats = new FullStats(terrainFeature); else stats.add(terrainFeature); } @@ -70,43 +70,43 @@ public class TileInfo if (hasViewableResource()) { stats.add(resource); - if(resource.Building!=null && City!=null && City.cityBuildings.IsBuilt(resource.Building)) + if(resource.building !=null && City!=null && City.cityBuildings.IsBuilt(resource.building)) { - stats.add(resource.GetBuilding().ResourceBonusStats); + stats.add(resource.GetBuilding().resourceBonusStats); } } TileImprovement improvement = getTileImprovement(); if (improvement != null) { - if (resource != null && resource.Improvement.equals(improvement.Name)) - stats.add(resource.ImprovementStats); + if (resource != null && resource.improvement.equals(improvement.name)) + stats.add(resource.improvementStats); else stats.add(improvement); - if (isResearched(improvement.ImprovingTech)) stats.add(improvement.ImprovingTechStats); + if (isResearched(improvement.improvingTech)) stats.add(improvement.improvingTechStats); } if (City != null && City.cityLocation.equals(position)) { - if (stats.Food < 2) stats.Food = 2; - if (stats.Production < 1) stats.Production = 1; + if (stats.food < 2) stats.food = 2; + if (stats.production < 1) stats.production = 1; } - if (stats.Production < 0) stats.Production = 0; + if (stats.production < 0) stats.production = 0; return stats; } public boolean canBuildImprovement(TileImprovement improvement) { Terrain topTerrain = terrainFeature ==null ? getBaseTerrain() : getTerrainFeature(); - if (improvement.TechRequired != null && !isResearched(improvement.TechRequired)) return false; - if (improvement.TerrainsCanBeBuiltOn.contains(topTerrain.Name)) return true; - if (topTerrain.Unbuildable) return false; - return resource != null && getTileResource().Improvement.equals(improvement.Name); + if (improvement.techRequired != null && !isResearched(improvement.techRequired)) return false; + if (improvement.terrainsCanBeBuiltOn.contains(topTerrain.name)) return true; + if (topTerrain.unbuildable) return false; + return resource != null && getTileResource().improvement.equals(improvement.name); } public void startWorkingOnImprovement(TileImprovement improvement) { - improvementInProgress = improvement.Name; - turnsToImprovement = improvement.TurnsToBuild; + improvementInProgress = improvement.name; + turnsToImprovement = improvement.turnsToBuild; } public void stopWorkingOnImprovement() @@ -142,7 +142,7 @@ public class TileInfo } public boolean hasViewableResource() { - return resource != null && (getTileResource().RevealedBy==null || isResearched(getTileResource().RevealedBy)); + return resource != null && (getTileResource().revealedBy ==null || isResearched(getTileResource().revealedBy)); } } \ No newline at end of file diff --git a/core/src/com/unciv/civinfo/TileMap.java b/core/src/com/unciv/civinfo/TileMap.java index 288c8a7bcd..1e0c495891 100644 --- a/core/src/com/unciv/civinfo/TileMap.java +++ b/core/src/com/unciv/civinfo/TileMap.java @@ -8,6 +8,7 @@ import com.unciv.models.LinqHashMap; import com.unciv.models.gamebasics.GameBasics; import com.unciv.models.gamebasics.ResourceType; import com.unciv.models.gamebasics.Terrain; +import com.unciv.models.gamebasics.TerrainType; import com.unciv.models.gamebasics.TileResource; public class TileMap{ @@ -29,30 +30,30 @@ public class TileMap{ final Terrain baseTerrain = Terrains.where(new Predicate() { @Override public boolean evaluate(Terrain arg0) { - return arg0.Type.equals("baseTerrain") && !arg0.Name.equals("Lakes"); + return arg0.type == TerrainType.BaseTerrain && !arg0.name.equals("Lakes"); } }).getRandom(); - tileInfo.baseTerrain = baseTerrain.Name; + tileInfo.baseTerrain = baseTerrain.name; - if (baseTerrain.CanHaveOverlay) { + if (baseTerrain.canHaveOverlay) { if (Math.random() > 0.7f) { Terrain SecondaryTerrain = Terrains.where(new Predicate() { @Override public boolean evaluate(Terrain arg0) { - return arg0.Type.equals("terrainFeature") && arg0.OccursOn.contains(baseTerrain.Name); + return arg0.type == TerrainType.TerrainFeature && arg0.occursOn.contains(baseTerrain.name); } }).getRandom(); - if (SecondaryTerrain != null) tileInfo.terrainFeature = SecondaryTerrain.Name; + if (SecondaryTerrain != null) tileInfo.terrainFeature = SecondaryTerrain.name; } } LinqCollection TileResources = GameBasics.TileResources.linqValues(); - // Resources are placed according to terrainFeature, if exists, otherwise according to BaseLayer. + // Resources are placed according to TerrainFeature, if exists, otherwise according to BaseLayer. TileResources = TileResources.where(new Predicate() { @Override public boolean evaluate(TileResource arg0) { - return arg0.TerrainsCanBeFoundOn.contains(tileInfo.getLastTerrain().Name); + return arg0.terrainsCanBeFoundOn.contains(tileInfo.getLastTerrain().name); } }); @@ -64,7 +65,7 @@ public class TileMap{ } else if (Math.random() < 1 / 10f) { resource = GetRandomResource(TileResources, ResourceType.Luxury); } - if (resource != null) tileInfo.resource = resource.Name; + if (resource != null) tileInfo.resource = resource.name; tiles.put(position.toString(),tileInfo); } @@ -89,7 +90,7 @@ public class TileMap{ return resources.where(new Predicate() { @Override public boolean evaluate(TileResource arg0) { - return arg0.ResourceType.equals(resourceType); + return arg0.resourceType.equals(resourceType); } }).getRandom(); } diff --git a/core/src/com/unciv/game/CityScreen.java b/core/src/com/unciv/game/CityScreen.java index a25f1c3ea9..78babc3d41 100644 --- a/core/src/com/unciv/game/CityScreen.java +++ b/core/src/com/unciv/game/CityScreen.java @@ -198,11 +198,11 @@ public class CityScreen extends CameraStageBaseScreen { CityStatsTable.row(); HashMap CityStatsValues = new LinkedHashMap(); - CityStatsValues.put("Production",stats.Production+""); - CityStatsValues.put("Food",stats.Food+" ("+cityInfo.cityPopulation.FoodStored+"/"+cityInfo.cityPopulation.FoodToNextPopulation()+")"); - CityStatsValues.put("Gold",stats.Gold+""); - CityStatsValues.put("Science",stats.Science+""); - CityStatsValues.put("Culture",stats.Culture+" ("+cityInfo.cultureStored+"/"+cityInfo.getCultureToNextTile()+")"); + CityStatsValues.put("production",stats.production +""); + CityStatsValues.put("food",stats.food +" ("+cityInfo.cityPopulation.FoodStored+"/"+cityInfo.cityPopulation.FoodToNextPopulation()+")"); + CityStatsValues.put("gold",stats.gold +""); + CityStatsValues.put("science",stats.science +""); + CityStatsValues.put("culture",stats.culture +" ("+cityInfo.cultureStored+"/"+cityInfo.getCultureToNextTile()+")"); CityStatsValues.put("Population",cityInfo.getFreePopulation()+"/"+cityInfo.cityPopulation.Population); for(String key : CityStatsValues.keySet()){ @@ -250,11 +250,11 @@ public class CityScreen extends CameraStageBaseScreen { TileTable.row(); HashMap TileStatsValues = new HashMap(); - TileStatsValues.put("Production",stats.Production+""); - TileStatsValues.put("Food",stats.Food+""); - TileStatsValues.put("Gold",stats.Gold+""); - TileStatsValues.put("Science",stats.Science+""); - TileStatsValues.put("Culture",stats.Culture+""); + TileStatsValues.put("production",stats.production +""); + TileStatsValues.put("food",stats.food +""); + TileStatsValues.put("gold",stats.gold +""); + TileStatsValues.put("science",stats.science +""); + TileStatsValues.put("culture",stats.culture +""); for(String key : TileStatsValues.keySet()){ if(TileStatsValues.get(key).equals("0")) continue; // this tile gives nothing of this stat, so why even display it? diff --git a/core/src/com/unciv/game/CivilopediaScreen.java b/core/src/com/unciv/game/CivilopediaScreen.java index feaa609274..377bb18506 100644 --- a/core/src/com/unciv/game/CivilopediaScreen.java +++ b/core/src/com/unciv/game/CivilopediaScreen.java @@ -62,7 +62,7 @@ public class CivilopediaScreen extends CameraStageBaseScreen { public void clicked(InputEvent event, float x, float y) { ICivilopedia building = nameList.getSelected(); if (building == null) return; - label.setText(building.GetDescription()); + label.setText(building.getDescription()); super.clicked(event, x, y); } }; diff --git a/core/src/com/unciv/game/TileGroup.java b/core/src/com/unciv/game/TileGroup.java index 52545d35e4..a03beb3ab5 100644 --- a/core/src/com/unciv/game/TileGroup.java +++ b/core/src/com/unciv/game/TileGroup.java @@ -21,7 +21,7 @@ public class TileGroup extends Group { TileGroup(TileInfo tileInfo){ this.tileInfo = tileInfo; - String terrainFileName = "TerrainIcons/" + tileInfo.getLastTerrain().Name.replace(' ','_') + "_(Civ5).png"; + String terrainFileName = "TerrainIcons/" + tileInfo.getLastTerrain().name.replace(' ','_') + "_(Civ5).png"; terrainImage = ImageGetter.getImageByFilename(terrainFileName); terrainImage.setSize(50,50); addActor(terrainImage); diff --git a/core/src/com/unciv/game/UnCivGame.java b/core/src/com/unciv/game/UnCivGame.java index a60e91f43c..3a8b558959 100644 --- a/core/src/com/unciv/game/UnCivGame.java +++ b/core/src/com/unciv/game/UnCivGame.java @@ -73,16 +73,16 @@ public class UnCivGame extends Game { TechColumn[] TechColumns = GetFromJson(TechColumn[].class, "Techs"); GameBasics.Technologies = new LinqHashMap(); for(TechColumn techColumn : TechColumns){ - for(com.unciv.models.gamebasics.Technology tech : techColumn.Techs){ - tech.Cost = techColumn.TechCost; - tech.Column = techColumn; - GameBasics.Technologies.put(tech.Name,tech); + for(com.unciv.models.gamebasics.Technology tech : techColumn.techs){ + tech.cost = techColumn.techCost; + tech.column = techColumn; + GameBasics.Technologies.put(tech.name,tech); } } for(com.unciv.models.gamebasics.Building building : GameBasics.Buildings.values()){ - if(building.RequiredTech == null) continue; - TechColumn column = building.GetRequiredTech().Column; - building.Cost = building.IsWonder ? column.WonderCost : column.BuildingCost; + if(building.requiredTech == null) continue; + TechColumn column = building.GetRequiredTech().column; + building.cost = building.isWonder ? column.wonderCost : column.buildingCost; } } diff --git a/core/src/com/unciv/game/WorldScreen.java b/core/src/com/unciv/game/WorldScreen.java index 9e31df462e..ed44a63720 100644 --- a/core/src/com/unciv/game/WorldScreen.java +++ b/core/src/com/unciv/game/WorldScreen.java @@ -162,11 +162,11 @@ public class WorldScreen extends CameraStageBaseScreen { CivStats nextTurnStats = game.civInfo.getStatsForNextTurn(); - CivTable.add(new Label("Gold: " + currentStats.Gold + "(" +(nextTurnStats.Gold>0?"+":"") + nextTurnStats.Gold+")", skin)); + CivTable.add(new Label("gold: " + currentStats.gold + "(" +(nextTurnStats.gold >0?"+":"") + nextTurnStats.gold +")", skin)); - CivTable.add(new Label("Science: +" + nextTurnStats.Science, skin)); - CivTable.add(new Label("Happiness: " + nextTurnStats.Happiness, skin)); - CivTable.add(new Label("Culture: " + currentStats.Culture + "(+" + nextTurnStats.Culture+")", skin)); + CivTable.add(new Label("science: +" + nextTurnStats.science, skin)); + CivTable.add(new Label("happiness: " + nextTurnStats.happiness, skin)); + CivTable.add(new Label("culture: " + currentStats.culture + "(+" + nextTurnStats.culture +")", skin)); CivTable.pack(); @@ -291,11 +291,11 @@ public class WorldScreen extends CameraStageBaseScreen { TileTable.row(); HashMap TileStatsValues = new HashMap(); - TileStatsValues.put("Production",stats.Production+""); - TileStatsValues.put("Food",stats.Food+""); - TileStatsValues.put("Gold",stats.Gold+""); - TileStatsValues.put("Science",stats.Science+""); - TileStatsValues.put("Culture",stats.Culture+""); + TileStatsValues.put("production",stats.production +""); + TileStatsValues.put("food",stats.food +""); + TileStatsValues.put("gold",stats.gold +""); + TileStatsValues.put("science",stats.science +""); + TileStatsValues.put("culture",stats.culture +""); for(String key : TileStatsValues.keySet()){ if(TileStatsValues.get(key).equals("0")) continue; // this tile gives nothing of this stat, so why even display it? diff --git a/core/src/com/unciv/game/pickerscreens/BuildingPickerScreen.java b/core/src/com/unciv/game/pickerscreens/BuildingPickerScreen.java index ece082efbb..b938de3c95 100644 --- a/core/src/com/unciv/game/pickerscreens/BuildingPickerScreen.java +++ b/core/src/com/unciv/game/pickerscreens/BuildingPickerScreen.java @@ -30,7 +30,7 @@ public class BuildingPickerScreen extends PickerScreen { rightSideButton.addListener(new ClickListener(){ @Override public void clicked(InputEvent event, float x, float y) { - game.civInfo.getCurrentCity().cityBuildings.CurrentBuilding = selectedBuilding.Name; + game.civInfo.getCurrentCity().cityBuildings.CurrentBuilding = selectedBuilding.name; game.setScreen(new CityScreen(game)); dispose(); } @@ -41,15 +41,15 @@ public class BuildingPickerScreen extends PickerScreen { CityBuildings cityBuildings = game.civInfo.getCurrentCity().cityBuildings; for(final Building building : GameBasics.Buildings.values()) { if(!cityBuildings.CanBuild(building)) continue; - TextButton TB = new TextButton(building.Name+"\r\n"+cityBuildings.TurnsToBuilding(building.Name)+" turns", skin); + TextButton TB = new TextButton(building.name +"\r\n"+cityBuildings.TurnsToBuilding(building.name)+" turns", skin); TB.addListener(new ClickListener(){ @Override public void clicked(InputEvent event, float x, float y) { selectedBuilding = building; rightSideButton.setTouchable(Touchable.enabled); - rightSideButton.setText("Build "+building.Name); + rightSideButton.setText("Build "+building.name); rightSideButton.setColor(Color.WHITE); - descriptionLabel.setText(building.GetDescription()); + descriptionLabel.setText(building.getDescription()); } }); topTable.add(TB).pad(10); diff --git a/core/src/com/unciv/game/pickerscreens/ImprovementPickerScreen.java b/core/src/com/unciv/game/pickerscreens/ImprovementPickerScreen.java index b367d3ac54..8b049a08b0 100644 --- a/core/src/com/unciv/game/pickerscreens/ImprovementPickerScreen.java +++ b/core/src/com/unciv/game/pickerscreens/ImprovementPickerScreen.java @@ -1,7 +1,6 @@ package com.unciv.game.pickerscreens; import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.Touchable; import com.badlogic.gdx.scenes.scene2d.ui.TextButton; @@ -34,16 +33,16 @@ public class ImprovementPickerScreen extends PickerScreen { VerticalGroup regularImprovements = new VerticalGroup(); regularImprovements.space(10); for(final TileImprovement improvement : GameBasics.TileImprovements.values()) { - if(!tileInfo.canBuildImprovement(improvement) || improvement.Name.equals(tileInfo.improvement)) continue; - TextButton TB = new TextButton(improvement.Name+"\r\n"+improvement.TurnsToBuild+" turns", skin); + if(!tileInfo.canBuildImprovement(improvement) || improvement.name.equals(tileInfo.improvement)) continue; + TextButton TB = new TextButton(improvement.name +"\r\n"+improvement.turnsToBuild +" turns", skin); TB.addListener(new ClickListener(){ @Override public void clicked(InputEvent event, float x, float y) { SelectedImprovement = improvement; rightSideButton.setTouchable(Touchable.enabled); - rightSideButton.setText("Construct "+improvement.Name); + rightSideButton.setText("Construct "+improvement.name); rightSideButton.setColor(Color.WHITE); - descriptionLabel.setText(improvement.GetDescription()); + descriptionLabel.setText(improvement.getDescription()); } }); regularImprovements.addActor(TB); diff --git a/core/src/com/unciv/game/pickerscreens/TechPickerScreen.java b/core/src/com/unciv/game/pickerscreens/TechPickerScreen.java index 7c60a24074..bc5ed9e4e4 100644 --- a/core/src/com/unciv/game/pickerscreens/TechPickerScreen.java +++ b/core/src/com/unciv/game/pickerscreens/TechPickerScreen.java @@ -36,13 +36,13 @@ public class TechPickerScreen extends PickerScreen { if (SelectedTech != null) { Technology thisTech = GameBasics.Technologies.get(techName); - if (techName.equals(SelectedTech.Name)) { + if (techName.equals(SelectedTech.name)) { TB.setChecked(true); TB.setColor(TB.getColor().lerp(Color.LIGHT_GRAY, 0.5f)); } - if (thisTech.Prerequisites.contains(SelectedTech.Name)) TB.setText("*" + techName); - else if (SelectedTech.Prerequisites.contains(techName)) TB.setText(techName + "*"); + if (thisTech.prerequisites.contains(SelectedTech.name)) TB.setText("*" + techName); + else if (SelectedTech.prerequisites.contains(techName)) TB.setText(techName + "*"); } if (TechsToResearch.contains(techName)) { TB.setText(TB.getText() + " (" + TechsToResearch.indexOf(techName) + ")"); @@ -54,9 +54,9 @@ public class TechPickerScreen extends PickerScreen { public void selectTechnology(Technology tech) { SelectedTech = tech; - descriptionLabel.setText(tech.Description); + descriptionLabel.setText(tech.description); - if (civTech.IsResearched(tech.Name)) { + if (civTech.IsResearched(tech.name)) { rightSideButton.setText("Research"); rightSideButton.setTouchable(Touchable.disabled); rightSideButton.setColor(Color.GRAY); @@ -67,19 +67,19 @@ public class TechPickerScreen extends PickerScreen { rightSideButton.setTouchable(Touchable.enabled); rightSideButton.setColor(Color.WHITE); - if (civTech.CanBeResearched(tech.Name)) { + if (civTech.CanBeResearched(tech.name)) { TechsToResearch.clear(); - TechsToResearch.add(tech.Name); + TechsToResearch.add(tech.name); } else { Stack Prerequisites = new Stack(); ArrayDeque CheckPrerequisites = new ArrayDeque(); - CheckPrerequisites.add(tech.Name); + CheckPrerequisites.add(tech.name); while (!CheckPrerequisites.isEmpty()) { String techNameToCheck = CheckPrerequisites.pop(); if (civTech.IsResearched(techNameToCheck)) continue; //no need to add or check prerequisites Technology techToCheck = GameBasics.Technologies.get(techNameToCheck); - for (String str : techToCheck.Prerequisites) + for (String str : techToCheck.prerequisites) if (!CheckPrerequisites.contains(str)) CheckPrerequisites.add(str); Prerequisites.add(techNameToCheck); } @@ -100,7 +100,7 @@ public class TechPickerScreen extends PickerScreen { } for (Technology technology : GameBasics.Technologies.linqValues()) { - techMatrix[technology.Column.ColumnNumber][technology.Row - 1] = technology; + techMatrix[technology.column.columnNumber][technology.row - 1] = technology; } // Table topTable = new Table(); @@ -112,7 +112,7 @@ public class TechPickerScreen extends PickerScreen { if (tech == null) topTable.add(); // empty cell else { final TextButton TB = new TextButton("", skin); - techNameToButton.put(tech.Name, TB); + techNameToButton.put(tech.name, TB); TB.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { diff --git a/core/src/com/unciv/models/gamebasics/BasicHelp.java b/core/src/com/unciv/models/gamebasics/BasicHelp.java index dc71062e80..383e526503 100644 --- a/core/src/com/unciv/models/gamebasics/BasicHelp.java +++ b/core/src/com/unciv/models/gamebasics/BasicHelp.java @@ -3,10 +3,10 @@ package com.unciv.models.gamebasics; import com.unciv.models.stats.NamedStats; public class BasicHelp extends NamedStats implements ICivilopedia { - public String Description; + public String description; @Override - public String GetDescription() { - return Description; + public String getDescription() { + return description; } } diff --git a/core/src/com/unciv/models/gamebasics/Building.java b/core/src/com/unciv/models/gamebasics/Building.java index b0dc991b8f..cf865a1c55 100644 --- a/core/src/com/unciv/models/gamebasics/Building.java +++ b/core/src/com/unciv/models/gamebasics/Building.java @@ -1,37 +1,34 @@ package com.unciv.models.gamebasics; -import com.unciv.models.LinqHashMap; import com.unciv.models.stats.FullStats; import com.unciv.models.stats.NamedStats; -import java.util.Dictionary; - public class Building extends NamedStats implements ICivilopedia { - public String Description; - public String RequiredTech; - public Technology GetRequiredTech(){return GameBasics.Technologies.get(RequiredTech);} - public int Cost; - public int Maintainance = 0; - public FullStats PercentStatBonus = new FullStats(); + public String description; + public String requiredTech; + public Technology GetRequiredTech(){return GameBasics.Technologies.get(requiredTech);} + public int cost; + public int maintainance = 0; + public FullStats percentStatBonus = new FullStats(); //public Func GetFlatBonusStats; - public boolean IsWonder = false; - public boolean ResourceRequired = false; - public String RequiredBuilding; - public String RequiredBuildingInAllCities; + public boolean isWonder = false; + public boolean resourceRequired = false; + public String requiredBuilding; + public String requiredBuildingInAllCities; // Uniques - public String ProvidesFreeBuilding; - public int FreeTechs; - public int NewTileCostReduction; + public String providesFreeBuilding; + public int freeTechs; + public int newTileCostReduction; /** The bonus stats that a resource gets when this building is built */ - public FullStats ResourceBonusStats; + public FullStats resourceBonusStats; - public String GetDescription() { + public String getDescription() { FullStats stats = new FullStats(this); StringBuilder stringBuilder = new StringBuilder(); - if(IsWonder) stringBuilder.append("Wonder\r\n"); - stringBuilder.append(Description + "\r\n" + stats); + if(isWonder) stringBuilder.append("Wonder\r\n"); + stringBuilder.append(description + "\r\n" + stats); return stringBuilder.toString(); } } diff --git a/core/src/com/unciv/models/gamebasics/ICivilopedia.java b/core/src/com/unciv/models/gamebasics/ICivilopedia.java index 3a5dc8bd4d..47090a2028 100644 --- a/core/src/com/unciv/models/gamebasics/ICivilopedia.java +++ b/core/src/com/unciv/models/gamebasics/ICivilopedia.java @@ -5,5 +5,5 @@ package com.unciv.models.gamebasics; */ public interface ICivilopedia { - public String GetDescription(); + public String getDescription(); } diff --git a/core/src/com/unciv/models/gamebasics/TechColumn.java b/core/src/com/unciv/models/gamebasics/TechColumn.java index 3e6ebe9568..089491fefa 100644 --- a/core/src/com/unciv/models/gamebasics/TechColumn.java +++ b/core/src/com/unciv/models/gamebasics/TechColumn.java @@ -4,10 +4,10 @@ import java.util.ArrayList; public class TechColumn { - public int ColumnNumber; + public int columnNumber; public GameBasics gameBasics; - public ArrayList Techs = new ArrayList(); - public int TechCost; - public int BuildingCost; - public int WonderCost; + public ArrayList techs = new ArrayList(); + public int techCost; + public int buildingCost; + public int wonderCost; } diff --git a/core/src/com/unciv/models/gamebasics/Technology.java b/core/src/com/unciv/models/gamebasics/Technology.java index 17770ddfe2..b5b0f05fdf 100644 --- a/core/src/com/unciv/models/gamebasics/Technology.java +++ b/core/src/com/unciv/models/gamebasics/Technology.java @@ -4,12 +4,12 @@ import java.util.ArrayList; public class Technology { - public String Name; + public String name; - public String Description; - public int Cost; - public ArrayList Prerequisites = new ArrayList(); + public String description; + public int cost; + public ArrayList prerequisites = new ArrayList(); - public TechColumn Column; // The column that this tech is in the tech tree - public int Row; + public TechColumn column; // The column that this tech is in the tech tree + public int row; } \ No newline at end of file diff --git a/core/src/com/unciv/models/gamebasics/Terrain.java b/core/src/com/unciv/models/gamebasics/Terrain.java index c507a12b13..7ed7045313 100644 --- a/core/src/com/unciv/models/gamebasics/Terrain.java +++ b/core/src/com/unciv/models/gamebasics/Terrain.java @@ -6,47 +6,35 @@ import com.unciv.models.stats.NamedStats; import java.util.Collection; public class Terrain extends NamedStats implements ICivilopedia { - public String Type; // baseTerrain or terrainFeature + public TerrainType type; // BaseTerrain or TerrainFeature - /// -/// For base terrain - comma-delimited 256 RGB values, e.g. "116,88,62" -/// - public String RGB; -// -//public Color Color -// { -// get -// { -// var rgbStringValues = RGB.Split(','); -// var rgbs = rgbStringValues.Select(x => int.Parse(x)).ToArray(); -// return Extensions.ColorFrom256RGB(rgbs[0], rgbs[1], rgbs[2]); -// } -// } + public boolean overrideStats = false; - public boolean OverrideStats = false; + /*** + * If true, other terrain layers can come over this one. For mountains, lakes etc. this is false + */ - /// -/// If true, other terrain layers can come over this one. For mountains, lakes etc. this is false -/// - public boolean CanHaveOverlay = true; + public boolean canHaveOverlay = true; - /// -/// If true, nothing can be built here - not even resource improvements -/// - public boolean Unbuildable = false; + /*** + *If true, nothing can be built here - not even resource improvements + */ + public boolean unbuildable = false; - /// -/// For terrain features -/// - public Collection OccursOn; + /*** + * For terrain features + */ + public Collection occursOn; - /// -/// For terrain features - which technology alllows removal of this feature -/// - public String RemovalTech; + /*** + *For terrain features - which technology alllows removal of this feature + */ + public String removalTech; + + public String rgb; @Override - public String GetDescription() { + public String getDescription() { return ""+new FullStats(this); } } diff --git a/core/src/com/unciv/models/gamebasics/TerrainType.java b/core/src/com/unciv/models/gamebasics/TerrainType.java new file mode 100644 index 0000000000..5e478eedd4 --- /dev/null +++ b/core/src/com/unciv/models/gamebasics/TerrainType.java @@ -0,0 +1,6 @@ +package com.unciv.models.gamebasics; + +public enum TerrainType{ + BaseTerrain, + TerrainFeature +} diff --git a/core/src/com/unciv/models/gamebasics/TileImprovement.java b/core/src/com/unciv/models/gamebasics/TileImprovement.java index 326d15dff0..67f631d7cd 100644 --- a/core/src/com/unciv/models/gamebasics/TileImprovement.java +++ b/core/src/com/unciv/models/gamebasics/TileImprovement.java @@ -8,33 +8,33 @@ import java.util.Collection; import java.util.HashMap; public class TileImprovement extends NamedStats implements ICivilopedia { - public Collection TerrainsCanBeBuiltOn = new ArrayList(); - public String TechRequired; + public Collection terrainsCanBeBuiltOn = new ArrayList(); + public String techRequired; - public String ImprovingTech; - public FullStats ImprovingTechStats; + public String improvingTech; + public FullStats improvingTechStats; - public int TurnsToBuild; + public int turnsToBuild; @Override - public String GetDescription() { + public String getDescription() { StringBuilder stringBuilder = new StringBuilder(); if(!new FullStats(this).toString().isEmpty()) stringBuilder.append(new FullStats(this)+"\r\n"); - if(!TerrainsCanBeBuiltOn.isEmpty()) stringBuilder.append("Can be built on " + StringUtils.join(", ", TerrainsCanBeBuiltOn)); + if(!terrainsCanBeBuiltOn.isEmpty()) stringBuilder.append("Can be built on " + StringUtils.join(", ", terrainsCanBeBuiltOn)); HashMap> statsToResourceNames = new HashMap>(); for(TileResource tr : GameBasics.TileResources.values()){ - if(!tr.Improvement.equals(Name)) continue; - String statsString = tr.ImprovementStats.toString(); + if(!tr.improvement.equals(name)) continue; + String statsString = tr.improvementStats.toString(); if(!statsToResourceNames.containsKey(statsString)) statsToResourceNames.put(statsString,new ArrayList()); - statsToResourceNames.get(statsString).add(tr.Name); + statsToResourceNames.get(statsString).add(tr.name); } for(String statsString : statsToResourceNames.keySet()){ stringBuilder.append("\r\n"+statsString+" for "+ StringUtils.join(", ",statsToResourceNames.get(statsString))); } - if(TechRequired!=null) stringBuilder.append("\r\ntech required: "+TechRequired); + if(techRequired !=null) stringBuilder.append("\r\ntech required: "+ techRequired); return stringBuilder.toString(); } diff --git a/core/src/com/unciv/models/gamebasics/TileResource.java b/core/src/com/unciv/models/gamebasics/TileResource.java index 8af79ba7d9..50be185921 100644 --- a/core/src/com/unciv/models/gamebasics/TileResource.java +++ b/core/src/com/unciv/models/gamebasics/TileResource.java @@ -6,26 +6,26 @@ import com.unciv.models.stats.FullStats; import java.util.Collection; public class TileResource extends NamedStats implements ICivilopedia { - public ResourceType ResourceType; - public Collection TerrainsCanBeFoundOn; - public String Improvement; - public FullStats ImprovementStats; + public ResourceType resourceType; + public Collection terrainsCanBeFoundOn; + public String improvement; + public FullStats improvementStats; /// /// The building that improves this resource, if any. E.G.: Granary for wheat, Stable for cattle. /// - public String Building; - public com.unciv.models.gamebasics.Building GetBuilding(){return Building==null ? null : GameBasics.Buildings.get(Building);} + public String building; + public Building GetBuilding(){return building ==null ? null : GameBasics.Buildings.get(building);} - public String RevealedBy; + public String revealedBy; @Override - public String GetDescription() { + public String getDescription() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(new FullStats(this)+"\r\n"); - stringBuilder.append("Can be found on " + com.unciv.models.gamebasics.StringUtils.join(", ",TerrainsCanBeFoundOn)); - stringBuilder.append("\r\n\r\nImproved by "+Improvement+"\r\n"); - stringBuilder.append("\r\nBonus stats for improvement: "+ImprovementStats+"\r\n"); + stringBuilder.append("Can be found on " + com.unciv.models.gamebasics.StringUtils.join(", ", terrainsCanBeFoundOn)); + stringBuilder.append("\r\n\r\nImproved by "+ improvement +"\r\n"); + stringBuilder.append("\r\nBonus stats for improvement: "+ improvementStats +"\r\n"); return stringBuilder.toString(); } } diff --git a/core/src/com/unciv/models/stats/CivStats.java b/core/src/com/unciv/models/stats/CivStats.java index e81482dc50..eead7d52b4 100644 --- a/core/src/com/unciv/models/stats/CivStats.java +++ b/core/src/com/unciv/models/stats/CivStats.java @@ -1,15 +1,15 @@ package com.unciv.models.stats; public class CivStats { - public int Gold = 0; - public int Science = 0; - public int Culture = 0; - public int Happiness = 0; + public int gold = 0; + public int science = 0; + public int culture = 0; + public int happiness = 0; public void add(CivStats other) { - Gold += other.Gold; - Science += other.Science; - Happiness += other.Happiness; - Culture += other.Culture; + gold += other.gold; + science += other.science; + happiness += other.happiness; + culture += other.culture; } } diff --git a/core/src/com/unciv/models/stats/FullStats.java b/core/src/com/unciv/models/stats/FullStats.java index 61ab58c32f..f1a26fbe77 100644 --- a/core/src/com/unciv/models/stats/FullStats.java +++ b/core/src/com/unciv/models/stats/FullStats.java @@ -2,8 +2,8 @@ package com.unciv.models.stats; public class FullStats extends CivStats // also used for hex stats, since it's basically the same { - public int Production = 0; - public int Food = 0; + public int production = 0; + public int food = 0; public FullStats() { } @@ -13,12 +13,12 @@ public class FullStats extends CivStats // also used for hex stats, since it's b } public void add(FullStats other){ - Gold+=other.Gold; - Science+=other.Science; - Happiness+=other.Happiness; - Culture+=other.Culture; - Food+=other.Food; - Production+=other.Production; + gold +=other.gold; + science +=other.science; + happiness +=other.happiness; + culture +=other.culture; + food +=other.food; + production +=other.production; } public String display(int value, String name){ @@ -27,12 +27,12 @@ public class FullStats extends CivStats // also used for hex stats, since it's b public String toString() { StringBuilder valuableParts = new StringBuilder(); - if (Production != 0) valuableParts.append(display(Production,"Production")); - if (Food != 0) valuableParts.append(display(Food,"Food")); - if (Gold != 0) valuableParts.append(display(Gold,"Gold")); - if (Science != 0) valuableParts.append(display(Science,"Science")); - if (Happiness != 0) valuableParts.append(display(Happiness,"Happpiness")); - if (Culture != 0) valuableParts.append(display(Culture,"Culture")); + if (production != 0) valuableParts.append(display(production,"production")); + if (food != 0) valuableParts.append(display(food,"food")); + if (gold != 0) valuableParts.append(display(gold,"gold")); + if (science != 0) valuableParts.append(display(science,"science")); + if (happiness != 0) valuableParts.append(display(happiness,"Happpiness")); + if (culture != 0) valuableParts.append(display(culture,"culture")); if (valuableParts.length() == 0) return ""; valuableParts.delete(0,1); return valuableParts.toString(); diff --git a/core/src/com/unciv/models/stats/NamedStats.java b/core/src/com/unciv/models/stats/NamedStats.java index 4d81c684b1..31c1bf34db 100644 --- a/core/src/com/unciv/models/stats/NamedStats.java +++ b/core/src/com/unciv/models/stats/NamedStats.java @@ -1,13 +1,13 @@ package com.unciv.models.stats; public class NamedStats extends FullStats { - public String Name; + public String name; public String GetName() { - return Name; + return name; } public String toString() { - return Name; + return name; } }