From 18d44a61e7199db9f6ccf5318b28fd5f5dfb142c Mon Sep 17 00:00:00 2001 From: IhateTrains Date: Sun, 24 Sep 2023 23:03:58 +0100 Subject: [PATCH] Fix some warnings (#1531) #patch --- ImperatorToCK3/CK3/Titles/Title.cs | 12 ++++++------ ImperatorToCK3/Outputter/BookmarkOutputter.cs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ImperatorToCK3/CK3/Titles/Title.cs b/ImperatorToCK3/CK3/Titles/Title.cs index 9fa1a316e..1bb8a6938 100644 --- a/ImperatorToCK3/CK3/Titles/Title.cs +++ b/ImperatorToCK3/CK3/Titles/Title.cs @@ -851,10 +851,10 @@ public void SetDeFactoLiege(Title? newLiege, Date date) { } [SerializeOnlyValue] public TitleCollection DeJureVassals { get; } = new(); // DIRECT de jure vassals - public Dictionary GetDeJureVassalsAndBelow() { + public IDictionary GetDeJureVassalsAndBelow() { return GetDeJureVassalsAndBelow("bcdke"); } - public Dictionary GetDeJureVassalsAndBelow(string rankFilter) { + public IDictionary GetDeJureVassalsAndBelow(string rankFilter) { var rankFilterAsArray = rankFilter.ToCharArray(); Dictionary deJureVassalsAndBelow = new(); foreach (var vassalTitle in DeJureVassals) { @@ -874,14 +874,14 @@ public Dictionary GetDeJureVassalsAndBelow(string rankFilter) { return deJureVassalsAndBelow; } - public Dictionary GetDeFactoVassals(Date date) { // DIRECT de facto vassals + public IDictionary GetDeFactoVassals(Date date) { // DIRECT de facto vassals return parentCollection.Where(t => t.GetDeFactoLiege(date)?.Id == Id) .ToDictionary(t => t.Id, t => t); } - public Dictionary GetDeFactoVassalsAndBelow(Date date) { + public IDictionary GetDeFactoVassalsAndBelow(Date date) { return GetDeFactoVassalsAndBelow(date, "bcdke"); } - public Dictionary GetDeFactoVassalsAndBelow(Date date, string rankFilter) { + public IDictionary GetDeFactoVassalsAndBelow(Date date, string rankFilter) { var rankFilterAsArray = rankFilter.ToCharArray(); Dictionary deFactoVassalsAndBelow = new(); foreach (var (vassalTitleName, vassalTitle) in GetDeFactoVassals(date)) { @@ -1052,7 +1052,7 @@ public void OutputHistory(StreamWriter writer) { writer.Write(sb); } - public HashSet GetProvincesInCountry(Date date) { + public ISet GetProvincesInCountry(Date date) { var holderId = GetHolderId(date); var heldCounties = new List( parentCollection.Where(t => t.GetHolderId(date) == holderId && t.Rank == TitleRank.county) diff --git a/ImperatorToCK3/Outputter/BookmarkOutputter.cs b/ImperatorToCK3/Outputter/BookmarkOutputter.cs index f6ff9b143..cad7d89a1 100644 --- a/ImperatorToCK3/Outputter/BookmarkOutputter.cs +++ b/ImperatorToCK3/Outputter/BookmarkOutputter.cs @@ -208,7 +208,7 @@ private static void DrawBookmarkMap(Configuration config, List<Title> playerTitl foreach (var playerTitle in playerTitles) { var colorOnMap = playerTitle.Color1 ?? new commonItems.Colors.Color(0, 0, 0); var rgba32ColorOnMap = new Rgba32((byte)colorOnMap.R, (byte)colorOnMap.G, (byte)colorOnMap.B); - HashSet<ulong> heldProvinces = playerTitle.GetProvincesInCountry(config.CK3BookmarkDate); + ISet<ulong> heldProvinces = playerTitle.GetProvincesInCountry(config.CK3BookmarkDate); // Determine which impassables should be be colored by the country var provincesToColor = new HashSet<ulong>(heldProvinces); var impassables = mapData.ColorableImpassableProvinces;