Skip to content

Commit

Permalink
Convert major powers with at least 300 territories to empires (#1464)
Browse files Browse the repository at this point in the history
  • Loading branch information
IhateTrains authored Aug 6, 2023
1 parent fd1aa7e commit aae538d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
26 changes: 9 additions & 17 deletions ImperatorToCK3/Imperator/Countries/Country.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,17 @@ public SortedSet<string> GetLaws() {
_ => monarchyLaws,
};
}
public int TerritoriesCount => ownedProvinces.Count;
public CountryRank Rank {
get {
var provCount = ownedProvinces.Count;
if (provCount == 0) {
return CountryRank.migrantHorde;
}
if (provCount == 1) {
return CountryRank.cityState;
}
if (provCount <= 24) {
return CountryRank.localPower;
}
if (provCount <= 99) {
return CountryRank.regionalPower;
}
if (provCount <= 499) {
return CountryRank.majorPower;
}
return CountryRank.greatPower;
return TerritoriesCount switch {
0 => CountryRank.migrantHorde,
1 => CountryRank.cityState,
<= 24 => CountryRank.localPower,
<= 99 => CountryRank.regionalPower,
<= 499 => CountryRank.majorPower,
_ => CountryRank.greatPower
};
}
}
public void RegisterProvince(Province province) {
Expand Down
7 changes: 6 additions & 1 deletion ImperatorToCK3/Mappers/TagTitle/TagTitleMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,12 @@ private static string GetCK3TitleRank(Country country, string localizedTitleName
if (localizedTitleName.Contains("Kingdom", System.StringComparison.Ordinal)) {
return "k";
}


// Major power rank is very broad (from 100 to 499 territories). Consider 300+ territories as empire material.
if (country is {Rank: CountryRank.majorPower, TerritoriesCount: >= 300}) {
return "e";
}

switch (country.Rank) {
case CountryRank.migrantHorde:
case CountryRank.cityState:
Expand Down

0 comments on commit aae538d

Please sign in to comment.