did some tests, seems working ok most of the times, but in some cases I get something strange.
For example this code is supposed to merge two provinces of Italy:
List<Province> provinces = new List<Province>();
provinces.Add(map.GetProvince("Italy", "Matera"));
provinces.Add(map.GetProvince("Italy", "Potenza"));
map.ProvincesMerge(provinces, true); // <-- true means issue a redraw after the merge
but the end result after showing the provinces is two provinces called "Matera". While all the other provinces of Italy are correctly merged by county, according the the list I have passed (attached file "Italy_issue.png").
Also for France I get something strange: all the counties are built correctly according to the list of provinces I pass, except one. When I try to merge the provinces
1073,1112,1074,1082,1159,1160 (original id-s before any merge)
then for some reason 1082 (Bouches-du-Rhône) is left out. I have attached a screenshot called province_not_merged_france.png that shows the county of France after the merge and the faulty province.
Another thing, let's suppose the user is playing game#1, then he completes, or he goes back to the main menu, I call
map.SetProvinceGeoData(data);
map.DrawProvince((int)country, false, true);
in order to restore the original situation. All provinces seems fine.
Then let's suppose the user starts a new game#2 on the same Country, the merge is triggered again.
But if I then use this code:
int provinceIndex = map.GetProvinceIndex(p);
map.ToggleProvinceSurface(provinceIndex, true, color);
on many of the newly merged provinces, the province is colorized correctly, but then I need to access p.mainRegion.surfaceGameObject , which is now null, while it was not happening after the merge in game#1. Not sure if I'm doing something wrong, I'll try to dig more.
Best Regards