From d760b3ec88e087a8315da855b791af2070020995 Mon Sep 17 00:00:00 2001 From: IhateTrains Date: Sun, 17 Dec 2023 23:12:10 +0000 Subject: [PATCH] Fix some warnings (#1654) #patch --- ImperatorToCK3/CK3/Characters/Character.cs | 8 ++++---- ImperatorToCK3/CK3/Cultures/Culture.cs | 2 +- ImperatorToCK3/CK3/Cultures/CultureData.cs | 2 +- ImperatorToCK3/CK3/Map/MapData.cs | 4 ++-- ImperatorToCK3/CK3/Religions/HolySite.cs | 2 +- ImperatorToCK3/CK3/World.cs | 2 +- ImperatorToCK3/Outputter/BookmarkOutputter.cs | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ImperatorToCK3/CK3/Characters/Character.cs b/ImperatorToCK3/CK3/Characters/Character.cs index fbb063e55..de1944cb6 100644 --- a/ImperatorToCK3/CK3/Characters/Character.cs +++ b/ImperatorToCK3/CK3/Characters/Character.cs @@ -145,12 +145,12 @@ public string? DeathReason { } public bool Dead => DeathDate is not null; - public List Pregnancies { get; } = new(); + public IList Pregnancies { get; } = new List(); - public Dictionary MenAtArmsStacksPerType { get; } = new(); + public IDictionary MenAtArmsStacksPerType { get; } = new Dictionary(); - public Dictionary PrisonerIds { get; } = new(); // - public Dictionary Localizations { get; } = new(); + public IDictionary PrisonerIds { get; } = new Dictionary(); // + public IDictionary Localizations { get; } = new Dictionary(); public DNA? DNA { get; private set; } diff --git a/ImperatorToCK3/CK3/Cultures/Culture.cs b/ImperatorToCK3/CK3/Cultures/Culture.cs index 6f6301fb5..d7f985f4d 100644 --- a/ImperatorToCK3/CK3/Cultures/Culture.cs +++ b/ImperatorToCK3/CK3/Cultures/Culture.cs @@ -28,7 +28,7 @@ public Culture(string id, CultureData cultureData) { Heritage = cultureData.Heritage!; traditionIds = cultureData.TraditionIds; nameLists = cultureData.NameLists; - attributes = cultureData.Attributes; + attributes = new List>(cultureData.Attributes); } public string Serialize(string indent, bool withBraces) { diff --git a/ImperatorToCK3/CK3/Cultures/CultureData.cs b/ImperatorToCK3/CK3/Cultures/CultureData.cs index 10511295d..b0a211aa1 100644 --- a/ImperatorToCK3/CK3/Cultures/CultureData.cs +++ b/ImperatorToCK3/CK3/Cultures/CultureData.cs @@ -13,5 +13,5 @@ public record CultureData { public OrderedSet TraditionIds { get; set; } = new(); public OrderedSet NameLists { get; } = new(); - public List> Attributes { get; } = new(); + public IList> Attributes { get; } = new List>(); } \ No newline at end of file diff --git a/ImperatorToCK3/CK3/Map/MapData.cs b/ImperatorToCK3/CK3/Map/MapData.cs index f21fe0803..3a54a77c3 100644 --- a/ImperatorToCK3/CK3/Map/MapData.cs +++ b/ImperatorToCK3/CK3/Map/MapData.cs @@ -33,8 +33,8 @@ public override int GetHashCode() { } public SortedDictionary> NeighborsDict { get; } = new(); - public HashSet ColorableImpassableProvinces { get; } = new(); - public Dictionary ProvincePositions { get; } = new(); + public ISet ColorableImpassableProvinces { get; } = new HashSet(); + public IDictionary ProvincePositions { get; } = new Dictionary(); public ProvinceDefinitions ProvinceDefinitions { get; } public MapData(ModFilesystem ck3ModFS) { diff --git a/ImperatorToCK3/CK3/Religions/HolySite.cs b/ImperatorToCK3/CK3/Religions/HolySite.cs index 4d671cf98..f490d45e2 100644 --- a/ImperatorToCK3/CK3/Religions/HolySite.cs +++ b/ImperatorToCK3/CK3/Religions/HolySite.cs @@ -17,7 +17,7 @@ public sealed partial class HolySite : IIdentifiable, IPDXSerializable { [NonSerialized] public Title? Barony { get; } [SerializedName("county")] public string? CountyId => County?.Id; [SerializedName("barony")] public string? BaronyId => Barony?.Id; - [SerializedName("character_modifier")] public Dictionary CharacterModifier { get; set; } = new(); + [SerializedName("character_modifier")] public IDictionary CharacterModifier { get; set; } = new Dictionary(); [SerializedName("flag")] public string? Flag { get; set; } public HolySite(string id, BufferedReader holySiteReader, Title.LandedTitles landedTitles) { diff --git a/ImperatorToCK3/CK3/World.cs b/ImperatorToCK3/CK3/World.cs index 6c26231ab..42972795d 100644 --- a/ImperatorToCK3/CK3/World.cs +++ b/ImperatorToCK3/CK3/World.cs @@ -48,7 +48,7 @@ public class World { public ReligionCollection Religions { get; } public IdObjectCollection MenAtArmsTypes { get; } = new(); public MapData MapData { get; } - public List Wars { get; } = new(); + public IList Wars { get; } = new List(); /// /// Date based on I:R save date, but normalized for CK3 purposes. diff --git a/ImperatorToCK3/Outputter/BookmarkOutputter.cs b/ImperatorToCK3/Outputter/BookmarkOutputter.cs index afc48aeae..f0881d29f 100644 --- a/ImperatorToCK3/Outputter/BookmarkOutputter.cs +++ b/ImperatorToCK3/Outputter/BookmarkOutputter.cs @@ -90,7 +90,7 @@ public static void OutputBookmark(World world, Configuration config) { output.WriteLine($"\t\treligion={faithId}"); } output.WriteLine("\t\tdifficulty = \"BOOKMARK_CHARACTER_DIFFICULTY_EASY\""); - WritePosition(output, title, config, provincePositions); + WritePosition(output, title, config, provincePositions.AsReadOnly()); output.WriteLine("\t\tanimation = personality_rational"); output.WriteLine("\t}");