Skip to content

Commit 4581a70

Browse files
committed
Merge branch 'master' into invictus-compatch
2 parents ee2e131 + a9dc2a5 commit 4581a70

File tree

31 files changed

+94
-87
lines changed

31 files changed

+94
-87
lines changed

.github/workflows/build_dev_version.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
token: ${{ secrets.GITHUB_TOKEN }}
1616
expire-in: 0
1717

18-
1918
upload_dev_build_artifact:
2019
name: Upload development build
2120
needs: remove_old_artifacts
@@ -44,10 +43,6 @@ jobs:
4443
uses: actions/setup-dotnet@v3
4544
with:
4645
global-json-file: Fronter.NET/global.json
47-
env:
48-
BACKBLAZE_KEY_ID: ${{ secrets.BACKBLAZE_KEY_ID }}
49-
BACKBLAZE_APPLICATION_KEY: ${{ secrets.BACKBLAZE_APPLICATION_KEY }}
50-
BACKBLAZE_BUCKET_ID: ${{ secrets.BACKBLAZE_BUCKET_ID }}
5146
- name: "Replace frontend background image"
5247
run: |
5348
rm Fronter.NET/Fronter.NET/Assets/Images/background.png
@@ -57,6 +52,10 @@ jobs:
5752
with:
5853
fronter_dir: 'Fronter.NET'
5954
release_dir: 'Publish'
55+
env:
56+
BACKBLAZE_KEY_ID: ${{ secrets.BACKBLAZE_KEY_ID }}
57+
BACKBLAZE_APPLICATION_KEY: ${{ secrets.BACKBLAZE_APPLICATION_KEY }}
58+
BACKBLAZE_BUCKET_ID: ${{ secrets.BACKBLAZE_BUCKET_ID }}
6059
- name: Setup Dotnet for use with actions
6160
uses: actions/setup-dotnet@v3
6261
with:

ImperatorToCK3.UnitTests/CK3/Characters/CharacterCollectionTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ public void ImperatorCountriesGoldCanBeDistributedAmongRulerAndVassals() {
263263
);
264264
var governorship1 = new Governorship(governorshipReader1, imperatorWorld.Countries, imperatorWorld.ImperatorRegionMapper);
265265
var governorship2 = new Governorship(governorshipReader2, imperatorWorld.Countries, imperatorWorld.ImperatorRegionMapper);
266-
imperatorWorld.Jobs.Governorships.Add(governorship1);
267-
imperatorWorld.Jobs.Governorships.Add(governorship2);
266+
imperatorWorld.JobsDB.Governorships.Add(governorship1);
267+
imperatorWorld.JobsDB.Governorships.Add(governorship2);
268268

269269
var titles = new Title.LandedTitles();
270270
titles.LoadTitles(new BufferedReader(@"

ImperatorToCK3.UnitTests/CK3/Titles/LandedTitlesTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public void GovernorshipsCanBeRecognizedAsCountyLevel() {
251251
"governorship = \"galatia_region\""
252252
);
253253
var governorship1 = new Governorship(reader, imperatorWorld.Countries, impRegionMapper);
254-
imperatorWorld.Jobs.Governorships.Add(governorship1);
254+
imperatorWorld.JobsDB.Governorships.Add(governorship1);
255255
var titles = new Title.LandedTitles();
256256
titles.LoadTitles(new BufferedReader(
257257
"c_county1 = { b_barony1={province=1} } " +

ImperatorToCK3.UnitTests/Imperator/Diplomacy/DiplomacyTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void WarWithNoDefendersIsSkipped() {
2020
3 = { previous=no defender=1 }
2121
}
2222
""");
23-
var diplomacy = new ImperatorToCK3.Imperator.Diplomacy.Diplomacy(reader);
23+
var diplomacy = new ImperatorToCK3.Imperator.Diplomacy.DiplomacyDB(reader);
2424

2525
Assert.Empty(diplomacy.Wars);
2626
var logStr = output.ToString();

ImperatorToCK3.UnitTests/Imperator/Jobs/JobsTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ public JobsTests() {
2828
}
2929
[Fact]
3030
public void GovernorshipsDefaultToEmpty() {
31-
var jobs = new ImperatorToCK3.Imperator.Jobs.Jobs();
31+
var jobs = new ImperatorToCK3.Imperator.Jobs.JobsDB();
3232
Assert.Empty(jobs.Governorships);
3333
}
3434
[Fact]
3535
public void GovernorshipsCanBeRead() {
3636
var reader = new BufferedReader(
3737
"province_job={who=1 governorship=galatia_region} province_job={who=2 governorship=galatia_region}"
3838
);
39-
var jobs = new ImperatorToCK3.Imperator.Jobs.Jobs(reader, countryCollection, irRegionMapper);
39+
var jobs = new ImperatorToCK3.Imperator.Jobs.JobsDB(reader, countryCollection, irRegionMapper);
4040
Assert.Collection(jobs.Governorships,
4141
item1 => Assert.Equal((ulong)1, item1.Country.Id),
4242
item2 => Assert.Equal((ulong)2, item2.Country.Id)
@@ -50,7 +50,7 @@ public void IgnoredTokensAreLogged() {
5050
var reader = new BufferedReader(
5151
"useless_job = {}"
5252
);
53-
_ = new ImperatorToCK3.Imperator.Jobs.Jobs(reader, countryCollection, irRegionMapper);
53+
_ = new ImperatorToCK3.Imperator.Jobs.JobsDB(reader, countryCollection, irRegionMapper);
5454

5555
Assert.Contains("Ignored Jobs tokens: useless_job", output.ToString());
5656
}

ImperatorToCK3.UnitTests/Mappers/Region/CK3RegionMapperTests.cs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using commonItems.Mods;
33
using ImperatorToCK3.CK3.Titles;
44
using ImperatorToCK3.Mappers.Region;
5+
using System;
56
using System.Collections.Generic;
67
using System.IO;
78
using Xunit;
@@ -38,9 +39,11 @@ public void LoadingBrokenRegionWillThrowException() {
3839
const string ck3Path = "TestFiles/regions/CK3RegionMapperTests/LoadingBrokenRegionWillThrowException";
3940
var ck3Root = Path.Combine(ck3Path, "game");
4041
var ck3ModFS = new ModFilesystem(ck3Root, new List<Mod>());
41-
void action() => mapper.LoadRegions(ck3ModFS, landedTitles);
42-
KeyNotFoundException exception = Assert.Throws<KeyNotFoundException>(action);
43-
Assert.Equal("Region's test_region2 region test_region does not exist!", exception.Message);
42+
43+
var output = new StringWriter();
44+
Console.SetOut(output);
45+
mapper.LoadRegions(ck3ModFS, landedTitles);
46+
Assert.Contains("Region's test_region2 region test_region does not exist!", output.ToString());
4447
}
4548
[Fact]
4649
public void LoadingBrokenDuchyWillThrowException() {
@@ -53,9 +56,11 @@ public void LoadingBrokenDuchyWillThrowException() {
5356
const string ck3Path = "TestFiles/regions/CK3RegionMapperTests/LoadingBrokenDuchyWillThrowException";
5457
var ck3Root = Path.Combine(ck3Path, "game");
5558
var ck3ModFS = new ModFilesystem(ck3Root, new List<Mod>());
56-
void action() => mapper.LoadRegions(ck3ModFS, landedTitles);
57-
KeyNotFoundException exception = Assert.Throws<KeyNotFoundException>(action);
58-
Assert.Equal("Region's test_region duchy d_aquitane does not exist!", exception.Message);
59+
60+
var output = new StringWriter();
61+
Console.SetOut(output);
62+
mapper.LoadRegions(ck3ModFS, landedTitles);
63+
Assert.Contains("Region's test_region duchy d_aquitane does not exist!", output.ToString());
5964
}
6065
[Fact]
6166
public void LoadingBrokenCountyWillThrowException() {
@@ -68,9 +73,11 @@ public void LoadingBrokenCountyWillThrowException() {
6873
const string ck3Path = "TestFiles/regions/CK3RegionMapperTests/LoadingBrokenCountyWillThrowException";
6974
var ck3Root = Path.Combine(ck3Path, "game");
7075
var ck3ModFS = new ModFilesystem(ck3Root, new List<Mod>());
71-
void Action() => mapper.LoadRegions(ck3ModFS, landedTitles);
72-
KeyNotFoundException exception = Assert.Throws<KeyNotFoundException>(Action);
73-
Assert.Equal("Region's test_region county c_mers does not exist!", exception.Message);
76+
77+
var output = new StringWriter();
78+
Console.SetOut(output);
79+
mapper.LoadRegions(ck3ModFS, landedTitles);
80+
Assert.Contains("Region's test_region county c_mers does not exist!", output.ToString());
7481
}
7582

7683
[Fact]

ImperatorToCK3.UnitTests/Mappers/TagTitle/MappingTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public void GovernorshipToDeJureDuchyMappingFailsIfDuchyIsNot60PercentControlled
113113
var irGovernorship = new Governorship(governorshipReader, irCountries, irRegionMapper);
114114
Assert.Equal(irRegionId, irGovernorship.Region.Id);
115115
Assert.Equal(irCountryId, irGovernorship.Country.Id);
116-
var jobs = new Jobs();
116+
var jobs = new JobsDB();
117117
jobs.Governorships.Add(irGovernorship);
118118

119119
const string duchyId = "d_galatia";

ImperatorToCK3/CK3/Provinces/ProvinceCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public void LoadPrehistory() {
146146
}
147147

148148
private static Imperator.Provinces.Province? DeterminePrimarySourceProvince(
149-
List<ulong> impProvinceNumbers,
149+
IEnumerable<ulong> impProvinceNumbers,
150150
Imperator.World irWorld
151151
) {
152152
// determine ownership by province development.

ImperatorToCK3/CK3/Religions/ReligionCollection.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
namespace ImperatorToCK3.CK3.Religions;
1717

1818
public class ReligionCollection : IdObjectCollection<string, Religion> {
19-
public Dictionary<string, OrderedSet<string>> ReplaceableHolySitesByFaith { get; } = new();
19+
private readonly Dictionary<string, OrderedSet<string>> replaceableHolySitesByFaith = new();
20+
public IReadOnlyDictionary<string, OrderedSet<string>> ReplaceableHolySitesByFaith => replaceableHolySitesByFaith;
2021
public IdObjectCollection<string, HolySite> HolySites { get; } = new();
2122
public IdObjectCollection<string, DoctrineCategory> DoctrineCategories { get; } = new();
2223

@@ -82,9 +83,9 @@ public void LoadReplaceableHolySites(string filePath) {
8283

8384
var valueStr = value.ToString();
8485
if (value.IsArrayOrObject()) {
85-
ReplaceableHolySitesByFaith[faithId] = new OrderedSet<string>(new BufferedReader(valueStr).GetStrings());
86+
replaceableHolySitesByFaith[faithId] = new OrderedSet<string>(new BufferedReader(valueStr).GetStrings());
8687
} else if (valueStr == "all") {
87-
ReplaceableHolySitesByFaith[faithId] = new OrderedSet<string>(faith.HolySiteIds);
88+
replaceableHolySitesByFaith[faithId] = new OrderedSet<string>(faith.HolySiteIds);
8889
} else {
8990
Logger.Warn($"Unexpected value: {valueStr}");
9091
}

ImperatorToCK3/CK3/Titles/LandedTitles.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ List<Governorship> countryLevelGovernorships
353353
) {
354354
Logger.Info("Importing Imperator Governorships...");
355355

356-
var governorships = irWorld.Jobs.Governorships;
356+
var governorships = irWorld.JobsDB.Governorships;
357357
var governorshipsPerRegion = governorships.GroupBy(g => g.Region.Id)
358358
.ToDictionary(g => g.Key, g => g.Count());
359359

ImperatorToCK3/CK3/Titles/Title.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -918,9 +918,9 @@ public Dictionary<string, Title> GetDeFactoVassalsAndBelow(Date date, string ran
918918
[SerializedName("always_follows_primary_heir")] public bool? AlwaysFollowsPrimaryHeir { get; set; }
919919
[SerializedName("de_jure_drift_disabled")] public bool? DeJureDriftDisabled { get; set; }
920920
[SerializedName("can_be_named_after_dynasty")] public bool? CanBeNamedAfterDynasty { get; set; }
921-
[SerializedName("male_names")] public List<string>? MaleNames { get; private set; }
921+
[SerializedName("male_names")] public IList<string>? MaleNames { get; private set; }
922922
// <culture, loc key>
923-
[SerializedName("cultural_names")] public Dictionary<string, string>? CulturalNames { get; private set; }
923+
[SerializedName("cultural_names")] public IDictionary<string, string>? CulturalNames { get; private set; }
924924

925925
public int? GetOwnOrInheritedDevelopmentLevel(Date date) {
926926
var ownDev = GetDevelopmentLevel(date);

ImperatorToCK3/CK3/Wars/War.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public class War {
1515
public Date EndDate { get; }
1616
public OrderedSet<string> TargetedTitles { get; } = new();
1717
public string? CasusBelli { get; }
18-
public List<string> Attackers { get; } = new();
19-
public List<string> Defenders { get; } = new();
18+
public IList<string> Attackers { get; } = new List<string>();
19+
public IList<string> Defenders { get; } = new List<string>();
2020
public string Claimant { get; }
2121

2222
public War(Imperator.Diplomacy.War irWar, Mappers.War.WarMapper warMapper, ProvinceMapper provinceMapper, Imperator.Countries.CountryCollection impCountries, StateCollection irStates, ProvinceCollection ck3Provinces, Title.LandedTitles titles, Date ck3BookmarkDate) {

ImperatorToCK3/CK3/World.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public World(Imperator.World impWorld, Configuration config) {
241241
);
242242

243243
// Give counties to rulers and governors.
244-
OverwriteCountiesHistory(impWorld.Jobs.Governorships, countyLevelGovernorships, impWorld.Characters, impWorld.Provinces, CorrectedDate);
244+
OverwriteCountiesHistory(impWorld.JobsDB.Governorships, countyLevelGovernorships, impWorld.Characters, impWorld.Provinces, CorrectedDate);
245245
// Import holding owners as barons and counts.
246246
LandedTitles.ImportImperatorHoldings(Provinces, impWorld.Characters, CorrectedDate);
247247

ImperatorToCK3/Imperator/Countries/Country.cs

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,17 @@ public SortedSet<string> GetLaws() {
6060
_ => monarchyLaws,
6161
};
6262
}
63+
public int TerritoriesCount => ownedProvinces.Count;
6364
public CountryRank Rank {
6465
get {
65-
var provCount = ownedProvinces.Count;
66-
if (provCount == 0) {
67-
return CountryRank.migrantHorde;
68-
}
69-
if (provCount == 1) {
70-
return CountryRank.cityState;
71-
}
72-
if (provCount <= 24) {
73-
return CountryRank.localPower;
74-
}
75-
if (provCount <= 99) {
76-
return CountryRank.regionalPower;
77-
}
78-
if (provCount <= 499) {
79-
return CountryRank.majorPower;
80-
}
81-
return CountryRank.greatPower;
66+
return TerritoriesCount switch {
67+
0 => CountryRank.migrantHorde,
68+
1 => CountryRank.cityState,
69+
<= 24 => CountryRank.localPower,
70+
<= 99 => CountryRank.regionalPower,
71+
<= 499 => CountryRank.majorPower,
72+
_ => CountryRank.greatPower
73+
};
8274
}
8375
}
8476
public void RegisterProvince(Province province) {

ImperatorToCK3/Imperator/Diplomacy/Diplomacy.cs renamed to ImperatorToCK3/Imperator/Diplomacy/DiplomacyDB.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
namespace ImperatorToCK3.Imperator.Diplomacy;
77

8-
public class Diplomacy {
9-
public List<War> Wars { get; } = new();
10-
public Diplomacy(BufferedReader reader) {
8+
public class DiplomacyDB {
9+
public IList<War> Wars { get; } = new List<War>();
10+
public DiplomacyDB(BufferedReader reader) {
1111
var parser = new Parser();
1212
parser.RegisterKeyword("database", databaseReader => {
1313
var databaseParser = new Parser();

ImperatorToCK3/Imperator/Diplomacy/War.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ namespace ImperatorToCK3.Imperator.Diplomacy;
77
public class War {
88
public Date StartDate { get; private set; } = new(1, 1, 1);
99
public bool Previous { get; private set; }
10-
public List<ulong> AttackerCountryIds { get; } = new();
11-
public List<ulong> DefenderCountryIds { get; } = new();
10+
public IList<ulong> AttackerCountryIds { get; } = new List<ulong>();
11+
public IList<ulong> DefenderCountryIds { get; } = new List<ulong>();
1212
public string? WarGoal { get; private set; }
1313
public ulong? TargetedStateId { get; private set; }
1414

ImperatorToCK3/Imperator/Jobs/Jobs.cs renamed to ImperatorToCK3/Imperator/Jobs/JobsDB.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
namespace ImperatorToCK3.Imperator.Jobs;
88

9-
public class Jobs {
10-
public List<Governorship> Governorships { get; } = new();
9+
public class JobsDB {
10+
public IList<Governorship> Governorships { get; } = new List<Governorship>();
1111

12-
public Jobs() { }
13-
public Jobs(BufferedReader jobsReader, CountryCollection countries, ImperatorRegionMapper irRegionMapper) {
12+
public JobsDB() { }
13+
public JobsDB(BufferedReader jobsReader, CountryCollection countries, ImperatorRegionMapper irRegionMapper) {
1414
var ignoredTokens = new IgnoredKeywordsSet();
1515
var parser = new Parser();
1616
parser.RegisterKeyword("province_job", reader => {

ImperatorToCK3/Imperator/Provinces/Province.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public partial class Province : IIdentifiable<ulong> {
1717
public State? State { get; private set; } = null;
1818
public Country? OwnerCountry { get; set; }
1919
public ulong Controller { get; set; } = 0;
20-
public Dictionary<ulong, Pop> Pops { get; set; } = new();
20+
public IDictionary<ulong, Pop> Pops { get; } = new Dictionary<ulong, Pop>();
2121
public ProvinceRank ProvinceRank { get; set; } = ProvinceRank.settlement;
2222
public bool Fort { get; set; } = false;
2323
public bool IsHolySite => HolySiteId is not null;
@@ -43,10 +43,10 @@ public int GetPopCount() {
4343
}
4444

4545
// Returns a count of linked pops
46-
public int LinkPops(PopCollection pops) {
46+
public int LinkPops(PopCollection popCollection) {
4747
int counter = 0;
4848
foreach (var popId in parsedPopIds) {
49-
if (pops.TryGetValue(popId, out var popToLink)) {
49+
if (popCollection.TryGetValue(popId, out var popToLink)) {
5050
Pops.Add(popId, popToLink);
5151
++counter;
5252
} else {

ImperatorToCK3/Imperator/World.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ public class World : Parser {
4646
public AreaCollection Areas { get; } = new();
4747
public ImperatorRegionMapper ImperatorRegionMapper { get; }
4848
public StateCollection States { get; } = new();
49-
public List<War> Wars { get; private set; } = new();
50-
public Jobs.Jobs Jobs { get; private set; } = new();
49+
public IList<War> Wars { get; private set; } = new List<War>();
50+
public Jobs.JobsDB JobsDB { get; private set; } = new();
5151
public UnitCollection Units { get; } = new();
5252
public CulturesDB CulturesDB { get; } = new();
5353
public ReligionCollection Religions { get; private set; }
@@ -193,14 +193,14 @@ public World(Configuration config, ConverterVersion converterVersion): this(conf
193193
});
194194
RegisterKeyword("diplomacy", reader => {
195195
Logger.Info("Loading diplomacy...");
196-
var diplomacy = new Diplomacy.Diplomacy(reader);
196+
var diplomacy = new Diplomacy.DiplomacyDB(reader);
197197
Wars = diplomacy.Wars;
198198
Logger.IncrementProgress();
199199
});
200200
RegisterKeyword("jobs", reader => {
201201
Logger.Info("Loading Jobs...");
202-
Jobs = new Jobs.Jobs(reader, Countries, ImperatorRegionMapper);
203-
Logger.Info($"Loaded {Jobs.Governorships.Capacity} governorships.");
202+
JobsDB = new Jobs.JobsDB(reader, Countries, ImperatorRegionMapper);
203+
Logger.Info($"Loaded {JobsDB.Governorships.Count} governorships.");
204204
Logger.IncrementProgress();
205205
});
206206
RegisterKeyword("deity_manager", reader => {

ImperatorToCK3/ImperatorToCK3.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
1717
<OutputPath>..\Debug\ImperatorToCK3\</OutputPath>
1818
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
19-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
2019
</PropertyGroup>
2120

2221
<PropertyGroup>
@@ -30,9 +29,13 @@
3029
<PackageReference Include="CsvHelper" Version="30.0.1" />
3130
<PackageReference Include="Fmod5Sharp" Version="3.0.1" />
3231
<PackageReference Include="Magick.NET-Q16-AnyCPU" Version="13.2.0" />
32+
<PackageReference Include="Meziantou.Analyzer" Version="2.0.80">
33+
<PrivateAssets>all</PrivateAssets>
34+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
35+
</PackageReference>
3336
<PackageReference Include="NAudio" Version="2.1.0" />
3437
<PackageReference Include="NAudio.Vorbis" Version="1.5.0" />
35-
<PackageReference Include="PGCG.commonItems" Version="8.2.0" />
38+
<PackageReference Include="PGCG.commonItems" Version="8.3.0" />
3639
<PackageReference Include="PGCG.commonItems.SourceGenerators" Version="1.0.3" />
3740
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.1" />
3841
</ItemGroup>

ImperatorToCK3/Mappers/Province/ProvinceMapper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
namespace ImperatorToCK3.Mappers.Province;
66

77
public class ProvinceMapper {
8-
private readonly Dictionary<ulong, List<ulong>> imperatorToCK3ProvinceMap = new();
9-
private readonly Dictionary<ulong, List<ulong>> ck3ToImperatorProvinceMap = new();
8+
private readonly Dictionary<ulong, IList<ulong>> imperatorToCK3ProvinceMap = new();
9+
private readonly Dictionary<ulong, IList<ulong>> ck3ToImperatorProvinceMap = new();
1010

1111
public void LoadMappings(string mappingsPath, string mappingsVersionName) {
1212
Logger.Info("Loading province mappings...");
@@ -49,14 +49,14 @@ private void CreateMappings(ProvinceMappingsVersion mappingsVersion) {
4949
}
5050
}
5151

52-
public List<ulong> GetImperatorProvinceNumbers(ulong ck3ProvinceNumber) {
52+
public IList<ulong> GetImperatorProvinceNumbers(ulong ck3ProvinceNumber) {
5353
if (ck3ToImperatorProvinceMap.TryGetValue(ck3ProvinceNumber, out var impProvs)) {
5454
return impProvs;
5555
}
5656
return new List<ulong>();
5757
}
5858

59-
public List<ulong> GetCK3ProvinceNumbers(ulong impProvinceNumber) {
59+
public IList<ulong> GetCK3ProvinceNumbers(ulong impProvinceNumber) {
6060
if (imperatorToCK3ProvinceMap.TryGetValue(impProvinceNumber, out var ck3Provs)) {
6161
return ck3Provs;
6262
}

0 commit comments

Comments
 (0)