diff --git a/C7GameData/ImportCiv3.cs b/C7GameData/ImportCiv3.cs index 1f18e9a4..e781d320 100644 --- a/C7GameData/ImportCiv3.cs +++ b/C7GameData/ImportCiv3.cs @@ -166,6 +166,7 @@ private SaveGame importBiq(string biqPath, string defaultBiqPath) { ImportSharedBiqData(); ImportBicLeaders(); ImportBicUnits(); + ImportBicCities(); Dictionary resourcesByIndex = ImportCiv3Resources(); SetMapDimensions(biq, save); @@ -439,6 +440,31 @@ private void ImportSavCities() { } } + private void ImportBicCities() { + BiqData theBiq = biq.Unit is null ? defaultBiq : biq; + + foreach (CITY city in theBiq.City) { + if (city.Owner < 0 || city.Owner >= save.Players.Count) { + continue; + } + SavePlayer player = save.Players[city.Owner]; + SaveCity saveCity = new SaveCity{ + id = ids.CreateID("city"), + owner = player.id, + location = new TileLocation(city.X, city.Y), + // TODO: try and get this from the unit prototype + producible = "Worker", + name = city.Name, + size = city.Size, + shieldsStored = 0, + foodStored = 0, + foodNeededToGrow = 20, // HACK: don't know where to find this + // residents = city.Ppod // TODO: load tiles worked from PPOD + }; + save.Cities.Add(saveCity); + } + } + private void ImportUnitPrototypes() { PRTO[] Prto = biq.Prto ?? defaultBiq.Prto; foreach (PRTO prto in Prto) {