Author Topic: map.GetProvince(provinceIndex)  (Read 707 times)

Eric

  • Newbie
  • *
  • Posts: 8
    • View Profile
map.GetProvince(provinceIndex)
« on: July 10, 2020, 08:31:43 PM »
It isn't always convenient to provide the country as an argument if a province is regularly changing hands, so it would be nice to have a method that returns the province object from its index.


Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 7361
    • View Profile
Re: map.GetProvince(provinceIndex)
« Reply #1 on: July 10, 2020, 08:35:39 PM »
Yes, in the meanwhile you can use map.provinces[provinceIndex] instead (doing proper null check as well).

Eric

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: map.GetProvince(provinceIndex)
« Reply #2 on: July 10, 2020, 10:04:11 PM »
That will work great, thanks.

I don't know what I didn't think of that. It seems obvious now in hindsight.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 7361
    • View Profile
Re: map.GetProvince(provinceIndex)
« Reply #3 on: July 11, 2020, 09:43:31 AM »
There's indeed a GetProvince(int provinceIndex)! As you asked the question, I doubt about its existence but then, yes, it's available for convenience, similar to GetCountry(int countryIndex).

Eric

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: map.GetProvince(provinceIndex)
« Reply #4 on: July 11, 2020, 02:25:09 PM »
Thanks!

Neither of those are in the documentation PDF. Only map.GetCountry(name) and map.GetProvince(provinceName, countryName).

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 7361
    • View Profile
Re: map.GetProvince(provinceIndex)
« Reply #5 on: July 11, 2020, 04:23:20 PM »
True. Added for future release.