# HG changeset patch # User Andrew # Date 1662070548 14400 # Thu Sep 01 18:15:48 2022 -0400 # Node ID 148e284fb684678c1dc27b268d1e437c33446243 # Parent 84312a371238605c19269f8e77360f658352b0c1 Zero-out infrastructure/manufacturing for non-updated cities, which were often higher than non-updated ones. Set countries/flags of XML cities across all files. So far they'll stick with the 1900 city/flag the whole time, except where already updated by the base turn events. diff --git a/src/main/java/com/ajtjp/gearCity/CityInfoFile/City.java b/src/main/java/com/ajtjp/gearCity/CityInfoFile/City.java --- a/src/main/java/com/ajtjp/gearCity/CityInfoFile/City.java +++ b/src/main/java/com/ajtjp/gearCity/CityInfoFile/City.java @@ -60,12 +60,7 @@ //alignment is always the empty string this.gOVERN = new GOVERN(1); this.tAX = new TAX(1.3); - if (city.getCountry().getName().equals("United Kingdom")) { - this.fLAG = new FLAG("UK.dds"); - } - else { - this.fLAG = new FLAG(city.getCountry().getName() + ".dds"); - } + setFlag(city.getCountry().getName()); this.pIC = new PIC("Generic.dds"); if (city.getPicture() != null) { this.pIC = new PIC(city.getPicture() + ".dds"); @@ -108,6 +103,21 @@ this.bUYRATE = "1"; } + public void setFlag(String countryName) { + if (countryName.equals("United Kingdom")) { + this.fLAG = new FLAG("UK.dds"); + } + else if (countryName.equals("Ottoman Empire")) { + this.fLAG = new FLAG("Ottoman.dds"); + } + else if (countryName.equals("Austria-Hungary")) { + this.fLAG = new FLAG("Austria_Hungry.dds"); //misspelled in the base game + } + else { + this.fLAG = new FLAG(countryName + ".dds"); + } + } + public void setBUYRATE(String bUYRATE) { this.bUYRATE = bUYRATE; } diff --git a/src/main/java/com/ajtjp/gearCity/Main.java b/src/main/java/com/ajtjp/gearCity/Main.java --- a/src/main/java/com/ajtjp/gearCity/Main.java +++ b/src/main/java/com/ajtjp/gearCity/Main.java @@ -14,7 +14,11 @@ import com.ajtjp.gearCity.CityInfoFile.POPULATION; import com.ajtjp.gearCity.CityInfoFile.BeanToXMLUtil; import com.ajtjp.gearCity.CityInfoFile.City; +import com.ajtjp.gearCity.CityInfoFile.INF; +import com.ajtjp.gearCity.CityInfoFile.MANUGROWTH; +import com.ajtjp.gearCity.CityInfoFile.MNFBASE; import com.ajtjp.gearCity.CityInfoFile.PIC; +import com.ajtjp.gearCity.CityInfoFile.SKILL; import com.ajtjp.gearCity.CityInfoFile.XMLToBeanObjUtil; import java.io.File; import java.io.FileNotFoundException; @@ -123,6 +127,10 @@ System.out.println("Updating XML stats for " + city); xml.setStatsFromDatabase(city, year, year + 10); } + else if (!city.getCountry().getName().equals(xml.getCOUNTRY().getNation())) { + xml.setCOUNTRY(new COUNTRY(city.getCountry().getName())); + xml.setFlag(city.getCountry().getName()); + } continue cityDBLoop; } } @@ -320,6 +328,10 @@ for(City city : cities) { city.getCORDS().setLat(String.valueOf(Double.valueOf(city.getCORDS().getLat()) - 0.2)); city.getCORDS().setLong(String.valueOf(Double.valueOf(city.getCORDS().getLong()) - 0.1)); + city.setMNFBASE(new MNFBASE(1)); + city.setINF(new INF(1)); + city.setMANUGROWTH(new MANUGROWTH(1.0)); + city.setSKILL(new SKILL(1)); citiesAlreadyExisting.add(city.getNAME().getName()); } System.out.println("There are " + cities.size() + " cities");