예제 #1
0
    public void AddProvincesToCountries()
    {
        string[] data = File.ReadAllLines("Assets/ProvinceMap/Resources/countryProvs.txt");

        for (int i = 0; i < data.Length; i++)
        {
            string[] elements = data[i].Split('#');
            Country  ci       = ProvinceController.instance.GetCountry(elements[0]);
            for (int j = 1; j < elements.Length; j++)
            {
                Province prov = ProvinceController.instance.GetProvince(int.Parse(elements[j]));
                prov.ProvinceInfo.ownerID  = ci.info.countryID;
                prov.ProvinceInfo.ownerTag = ci.info.tag;
                prov.ProvinceInfo.owner    = ci;

                ci.AddProvince(prov);
            }
        }
    }