private void ColourContries() { Debug.Log("Color Countries ___________________________________________________________________________________________________________________"); foreach (assemblyCsharp.Province prov in State.getProvinces().Values) { int provIndex = prov.getIndex(); WorldMapStrategyKit.Province mapProv = map.provinces[provIndex]; int countryIndex = mapProv.countryIndex; int nationIndex = prov.getOwnerIndex(); if (countryIndex != nationIndex) { Debug.Log("Reassign Nation"); mapProv.countryIndex = nationIndex; Region provRegion = mapProv.mainRegion; Country newOwnerCountry = map.countries[nationIndex]; map.CountryTransferProvinceRegion(countryIndex, provRegion, true); } } for (int k = 0; k < map.countries.Length; k++) { Color color = new Color(UnityEngine.Random.Range(0.0f, 0.65f), UnityEngine.Random.Range(0.0f, 0.65f), UnityEngine.Random.Range(0.0f, 0.65f)); Nation nation = State.getNations()[k]; // Debug.Log(nation.getName()); nation.setColor(color); map.ToggleCountrySurface(k, true, color); } }
public void TransferControlOfProvince(ProvinceIdentifier id, GameCountry newCountry) { Debug.Assert(id != null); Debug.Assert(newCountry != null); Debug.Log("Transferring control of province : " + id.Province); var province = _map.GetProvince(id.Province, id.Nation); var newCountryIndex = _map.GetCountryIndex(_map.GetCountry(newCountry.Name)); _map.CountryTransferProvinceRegion(newCountryIndex, province.mainRegion); //_map.ToggleCountryMainRegionSurface(newCountryIndex,true, _flagProvider.getFlag(newCountry.Flag)); //TODO: This graphical effect appears to be buggy. }