Skip to content

Commit

Permalink
Fix some warnings (#1654) #patch
Browse files Browse the repository at this point in the history
  • Loading branch information
IhateTrains authored Dec 17, 2023
1 parent 455b94b commit d760b3e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions ImperatorToCK3/CK3/Characters/Character.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ public string? DeathReason {
}

public bool Dead => DeathDate is not null;
public List<Pregnancy> Pregnancies { get; } = new();
public IList<Pregnancy> Pregnancies { get; } = new List<Pregnancy>();

public Dictionary<string, int> MenAtArmsStacksPerType { get; } = new();
public IDictionary<string, int> MenAtArmsStacksPerType { get; } = new Dictionary<string, int>();

public Dictionary<string, string> PrisonerIds { get; } = new(); // <prisoner id, imprisonment type>
public Dictionary<string, LocBlock> Localizations { get; } = new();
public IDictionary<string, string> PrisonerIds { get; } = new Dictionary<string, string>(); // <prisoner id, imprisonment type>
public IDictionary<string, LocBlock> Localizations { get; } = new Dictionary<string, LocBlock>();

public DNA? DNA { get; private set; }

Expand Down
2 changes: 1 addition & 1 deletion ImperatorToCK3/CK3/Cultures/Culture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<KeyValuePair<string, StringOfItem>>(cultureData.Attributes);
}

public string Serialize(string indent, bool withBraces) {
Expand Down
2 changes: 1 addition & 1 deletion ImperatorToCK3/CK3/Cultures/CultureData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ public record CultureData {
public OrderedSet<string> TraditionIds { get; set; } = new();
public OrderedSet<NameList> NameLists { get; } = new();

public List<KeyValuePair<string, StringOfItem>> Attributes { get; } = new();
public IList<KeyValuePair<string, StringOfItem>> Attributes { get; } = new List<KeyValuePair<string, StringOfItem>>();
}
4 changes: 2 additions & 2 deletions ImperatorToCK3/CK3/Map/MapData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public override int GetHashCode() {
}

public SortedDictionary<ulong, HashSet<ulong>> NeighborsDict { get; } = new();
public HashSet<ulong> ColorableImpassableProvinces { get; } = new();
public Dictionary<ulong, ProvincePosition> ProvincePositions { get; } = new();
public ISet<ulong> ColorableImpassableProvinces { get; } = new HashSet<ulong>();
public IDictionary<ulong, ProvincePosition> ProvincePositions { get; } = new Dictionary<ulong, ProvincePosition>();
public ProvinceDefinitions ProvinceDefinitions { get; }

public MapData(ModFilesystem ck3ModFS) {
Expand Down
2 changes: 1 addition & 1 deletion ImperatorToCK3/CK3/Religions/HolySite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public sealed partial class HolySite : IIdentifiable<string>, 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<string, object> CharacterModifier { get; set; } = new();
[SerializedName("character_modifier")] public IDictionary<string, object> CharacterModifier { get; set; } = new Dictionary<string, object>();
[SerializedName("flag")] public string? Flag { get; set; }

public HolySite(string id, BufferedReader holySiteReader, Title.LandedTitles landedTitles) {
Expand Down
2 changes: 1 addition & 1 deletion ImperatorToCK3/CK3/World.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class World {
public ReligionCollection Religions { get; }
public IdObjectCollection<string, MenAtArmsType> MenAtArmsTypes { get; } = new();
public MapData MapData { get; }
public List<Wars.War> Wars { get; } = new();
public IList<Wars.War> Wars { get; } = new List<Wars.War>();

/// <summary>
/// Date based on I:R save date, but normalized for CK3 purposes.
Expand Down
2 changes: 1 addition & 1 deletion ImperatorToCK3/Outputter/BookmarkOutputter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
Expand Down

0 comments on commit d760b3e

Please sign in to comment.