From f10e4c934fb910ef691b78a84b105792cd9735dd Mon Sep 17 00:00:00 2001 From: IhateTrains Date: Mon, 16 Dec 2024 02:27:43 +0000 Subject: [PATCH] Make more classes internal, reduce interface use (#2365) --- .../CK3/Characters/CK3CharacterTests.cs | 20 ++++++++--------- .../ImperatorToCK3.UnitTests.csproj | 4 ++-- .../TestHelpers/TestCK3CultureCollection.cs | 2 +- .../TestHelpers/TestImperatorWorld.cs | 2 +- ImperatorToCK3/CK3/Armies/MenAtArmsType.cs | 2 +- ImperatorToCK3/CK3/Characters/Character.cs | 8 +++---- .../CK3/Characters/CharacterCollection.cs | 2 +- .../CK3/Characters/CharactersLoader.cs | 2 +- ImperatorToCK3/CK3/Cultures/Culture.cs | 2 +- .../CK3/Cultures/CultureCollection.cs | 2 +- ImperatorToCK3/CK3/Cultures/CultureData.cs | 6 ++--- ImperatorToCK3/CK3/Cultures/Pillar.cs | 2 +- .../CK3/Cultures/PillarCollection.cs | 2 +- ImperatorToCK3/CK3/Cultures/PillarData.cs | 8 +++---- ImperatorToCK3/CK3/Dynasties/Dynasty.cs | 2 +- .../CK3/Dynasties/DynastyCollection.cs | 2 +- .../CK3/Dynasties/HouseCollection.cs | 2 +- ImperatorToCK3/CK3/Provinces/Province.cs | 2 +- .../CK3/Provinces/ProvinceCollection.cs | 2 +- .../CK3/Provinces/ProvinceHistory.cs | 2 +- ImperatorToCK3/CK3/Religions/Faith.cs | 2 +- ImperatorToCK3/CK3/Religions/FaithData.cs | 10 ++++----- ImperatorToCK3/CK3/Religions/HolySite.cs | 2 +- ImperatorToCK3/CK3/Religions/Religion.cs | 2 +- .../CK3/Religions/ReligionCollection.cs | 2 +- ImperatorToCK3/CK3/Titles/LandedTitles.cs | 2 +- ImperatorToCK3/CK3/Titles/RulerTerm.cs | 2 +- ImperatorToCK3/CK3/Titles/Title.cs | 22 +++++++++---------- ImperatorToCK3/CK3/Titles/TitleCollection.cs | 4 ++-- ImperatorToCK3/CK3/Titles/TitleHistory.cs | 2 +- ImperatorToCK3/CK3/Wars/War.cs | 6 ++--- ImperatorToCK3/CK3/World.cs | 5 ++--- .../CommonUtils/Genes/AccessoryGene.cs | 2 +- .../Genes/AccessoryGeneTemplate.cs | 4 ++-- ImperatorToCK3/CommonUtils/Genes/GenesDB.cs | 2 +- ImperatorToCK3/CommonUtils/Map/MapData.cs | 2 +- .../CommonUtils/Map/ProvinceDefinitions.cs | 4 ++-- .../Imperator/Characters/Character.cs | 9 ++++---- .../Characters/CharacterCollection.cs | 2 +- .../Imperator/Characters/PortraitData.cs | 7 +++--- ImperatorToCK3/Imperator/Countries/Country.cs | 8 +++---- .../Imperator/Countries/CountryCollection.cs | 2 +- .../Imperator/Countries/CountryFactory.cs | 2 +- .../Imperator/Countries/CountryName.cs | 2 +- .../Imperator/Countries/RulerTerm.cs | 2 +- .../Imperator/Diplomacy/DiplomacyDB.cs | 2 +- ImperatorToCK3/Imperator/Diplomacy/War.cs | 6 ++--- ImperatorToCK3/Imperator/Families/Family.cs | 2 +- .../Imperator/Families/FamilyCollection.cs | 2 +- ImperatorToCK3/Imperator/Geography/Area.cs | 2 +- .../Imperator/Geography/AreaCollection.cs | 2 +- ImperatorToCK3/Imperator/Jobs/Governorship.cs | 2 +- ImperatorToCK3/Imperator/Jobs/JobsDB.cs | 6 ++--- ImperatorToCK3/Imperator/Jobs/OfficeJob.cs | 2 +- .../Imperator/Provinces/Province.cs | 4 ++-- .../Imperator/Provinces/ProvinceCollection.cs | 2 +- .../Imperator/Provinces/ProvinceFactory.cs | 2 +- ImperatorToCK3/Imperator/States/State.cs | 2 +- .../Imperator/States/StateCollection.cs | 2 +- ImperatorToCK3/Imperator/States/StateData.cs | 2 +- ImperatorToCK3/Imperator/World.cs | 2 +- .../Mappers/Culture/CultureMapper.cs | 2 +- .../Mappers/Culture/CultureMappingRule.cs | 2 +- .../Mappers/Gene/AccessoryGeneMapper.cs | 4 ++-- .../Mappers/Province/ProvinceMapper.cs | 14 ++++++------ .../Mappers/Province/ProvinceMapping.cs | 4 ++-- .../Province/ProvinceMappingsVersion.cs | 2 +- ImperatorToCK3/Mappers/Region/CK3Region.cs | 2 +- .../Mappers/Region/CK3RegionMapper.cs | 2 +- .../Mappers/Region/ImperatorRegion.cs | 2 +- .../Mappers/Region/ImperatorRegionMapper.cs | 2 +- .../Mappers/Religion/ReligionMapper.cs | 2 +- .../Mappers/TagTitle/TagTitleMapper.cs | 2 +- .../Mappers/Technology/InnovationMapper.cs | 6 ++--- ImperatorToCK3/Outputter/BookmarkOutputter.cs | 2 +- .../Outputter/CharacterOutputter.cs | 2 +- .../Outputter/CharactersOutputter.cs | 2 +- ImperatorToCK3/Outputter/CulturesOutputter.cs | 2 +- .../Outputter/DynastiesOutputter.cs | 2 +- .../Outputter/LocalizationOutputter.cs | 2 +- .../Outputter/MenAtArmsOutputter.cs | 2 +- ImperatorToCK3/Outputter/PillarOutputter.cs | 2 +- ImperatorToCK3/Outputter/ProvinceOutputter.cs | 2 +- .../Outputter/ProvincesOutputter.cs | 2 +- .../Outputter/ReligionsOutputter.cs | 2 +- .../Outputter/SuccessionTriggersOutputter.cs | 2 +- ImperatorToCK3/Outputter/TitlesOutputter.cs | 2 +- ImperatorToCK3/Outputter/WarsOutputter.cs | 2 +- ImperatorToCK3/Outputter/WorldOutputter.cs | 2 +- 89 files changed, 150 insertions(+), 153 deletions(-) diff --git a/ImperatorToCK3.UnitTests/CK3/Characters/CK3CharacterTests.cs b/ImperatorToCK3.UnitTests/CK3/Characters/CK3CharacterTests.cs index 5eed9c8d7..4f35ade05 100644 --- a/ImperatorToCK3.UnitTests/CK3/Characters/CK3CharacterTests.cs +++ b/ImperatorToCK3.UnitTests/CK3/Characters/CK3CharacterTests.cs @@ -59,7 +59,7 @@ static CK3CharacterTests() { CultureMapper = new CultureMapper(IRRegionMapper, new CK3RegionMapper(), cultures); } - public class CK3CharacterBuilder { + internal class CK3CharacterBuilder { private Configuration config = new() { CK3BookmarkDate = ConversionDate, CK3Path = CK3Path @@ -76,7 +76,7 @@ public class CK3CharacterBuilder { private ProvinceMapper provinceMapper = new(); private DeathReasonMapper deathReasonMapper = new(); - public Character Build() { + internal Character Build() { IRRegionMapper.LoadRegions(IRModFS, new ColorFactory()); var character = new Character( @@ -98,19 +98,19 @@ public Character Build() { ); return character; } - public CK3CharacterBuilder WithImperatorCharacter(ImperatorToCK3.Imperator.Characters.Character imperatorCharacter) { + internal CK3CharacterBuilder WithImperatorCharacter(ImperatorToCK3.Imperator.Characters.Character imperatorCharacter) { this.imperatorCharacter = imperatorCharacter; return this; } - public CK3CharacterBuilder WithCharacterCollection(CharacterCollection characters) { + internal CK3CharacterBuilder WithCharacterCollection(CharacterCollection characters) { this.characters = characters; return this; } - public CK3CharacterBuilder WithReligionMapper(ReligionMapper religionMapper) { + internal CK3CharacterBuilder WithReligionMapper(ReligionMapper religionMapper) { this.religionMapper = religionMapper; return this; } - public CK3CharacterBuilder WithCultureMapper(CultureMapper cultureMapper) { + internal CK3CharacterBuilder WithCultureMapper(CultureMapper cultureMapper) { this.cultureMapper = cultureMapper; return this; } @@ -512,7 +512,7 @@ public void DeadLandlessCharactersArePurgedIfChildless() { landedCharacter.Father = fatherOfLandedCharacter; childlessRelative.Father = fatherOfLandedCharacter; - var dynasty = new ImperatorToCK3.CK3.Dynasties.Dynasty(irFamily, irCharacters, new CulturesDB(), CultureMapper, new LocDB("english"), new TestCK3LocDB(), ConversionDate); + var dynasty = new Dynasty(irFamily, irCharacters, new CulturesDB(), CultureMapper, new LocDB("english"), new TestCK3LocDB(), ConversionDate); var dynasties = new DynastyCollection { dynasty }; Assert.Equal(dynasty.Id, landedCharacter.GetDynastyId(ConversionDate)); Assert.Equal(dynasty.Id, fatherOfLandedCharacter.GetDynastyId(ConversionDate)); @@ -520,9 +520,9 @@ public void DeadLandlessCharactersArePurgedIfChildless() { ck3Characters.PurgeUnneededCharacters(titles, dynasties, new HouseCollection(), ConversionDate); - ck3Characters.Should().BeEquivalentTo(new[] { + ck3Characters.Should().BeEquivalentTo([ + fatherOfLandedCharacter, landedCharacter, - fatherOfLandedCharacter - }); + ]); } } \ No newline at end of file diff --git a/ImperatorToCK3.UnitTests/ImperatorToCK3.UnitTests.csproj b/ImperatorToCK3.UnitTests/ImperatorToCK3.UnitTests.csproj index 0811b5dbd..9fd9e02e0 100644 --- a/ImperatorToCK3.UnitTests/ImperatorToCK3.UnitTests.csproj +++ b/ImperatorToCK3.UnitTests/ImperatorToCK3.UnitTests.csproj @@ -16,10 +16,10 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/ImperatorToCK3.UnitTests/TestHelpers/TestCK3CultureCollection.cs b/ImperatorToCK3.UnitTests/TestHelpers/TestCK3CultureCollection.cs index 1a67b0153..75e0033db 100644 --- a/ImperatorToCK3.UnitTests/TestHelpers/TestCK3CultureCollection.cs +++ b/ImperatorToCK3.UnitTests/TestHelpers/TestCK3CultureCollection.cs @@ -5,7 +5,7 @@ namespace ImperatorToCK3.UnitTests.TestHelpers; -public class TestCK3CultureCollection() : CultureCollection(colorFactory, new PillarCollection(colorFactory, ck3ModFlags), ck3ModFlags) { +internal class TestCK3CultureCollection() : CultureCollection(colorFactory, new PillarCollection(colorFactory, ck3ModFlags), ck3ModFlags) { private static readonly ColorFactory colorFactory = new(); private static readonly OrderedDictionary ck3ModFlags = []; diff --git a/ImperatorToCK3.UnitTests/TestHelpers/TestImperatorWorld.cs b/ImperatorToCK3.UnitTests/TestHelpers/TestImperatorWorld.cs index c1d6ed643..e3d4b372d 100644 --- a/ImperatorToCK3.UnitTests/TestHelpers/TestImperatorWorld.cs +++ b/ImperatorToCK3.UnitTests/TestHelpers/TestImperatorWorld.cs @@ -2,4 +2,4 @@ namespace ImperatorToCK3.UnitTests.TestHelpers; -public class TestImperatorWorld(Configuration config) : World(config); \ No newline at end of file +internal class TestImperatorWorld(Configuration config) : World(config); \ No newline at end of file diff --git a/ImperatorToCK3/CK3/Armies/MenAtArmsType.cs b/ImperatorToCK3/CK3/Armies/MenAtArmsType.cs index a52bb73d0..b8114ed6a 100644 --- a/ImperatorToCK3/CK3/Armies/MenAtArmsType.cs +++ b/ImperatorToCK3/CK3/Armies/MenAtArmsType.cs @@ -8,7 +8,7 @@ namespace ImperatorToCK3.CK3.Armies; [SerializationByProperties] -public sealed partial class MenAtArmsType : IIdentifiable, IPDXSerializable { +internal sealed partial class MenAtArmsType : IIdentifiable, IPDXSerializable { [NonSerialized] public string Id { get; } [SerializedName("can_recruit")] public StringOfItem CanRecruit { get; private set; } = new("{}"); diff --git a/ImperatorToCK3/CK3/Characters/Character.cs b/ImperatorToCK3/CK3/Characters/Character.cs index 768185f9c..3e394e6da 100644 --- a/ImperatorToCK3/CK3/Characters/Character.cs +++ b/ImperatorToCK3/CK3/Characters/Character.cs @@ -23,7 +23,7 @@ namespace ImperatorToCK3.CK3.Characters; -public sealed class Character : IIdentifiable { +internal sealed class Character : IIdentifiable { public string Id { get; } public bool FromImperator { get; init; } = false; @@ -150,11 +150,11 @@ public string? DeathReason { } } - public IList Pregnancies { get; } = new List(); + public List Pregnancies { get; } = []; - public IDictionary MenAtArmsStacksPerType { get; } = new Dictionary(); + public Dictionary MenAtArmsStacksPerType { get; } = []; - public IDictionary PrisonerIds { get; } = new Dictionary(); // + public Dictionary PrisonerIds { get; } = []; // internal DNA? DNA { get; set; } diff --git a/ImperatorToCK3/CK3/Characters/CharacterCollection.cs b/ImperatorToCK3/CK3/Characters/CharacterCollection.cs index 73f909023..f51610ec8 100644 --- a/ImperatorToCK3/CK3/Characters/CharacterCollection.cs +++ b/ImperatorToCK3/CK3/Characters/CharacterCollection.cs @@ -26,7 +26,7 @@ namespace ImperatorToCK3.CK3.Characters; -public sealed partial class CharacterCollection : ConcurrentIdObjectCollection { +internal sealed partial class CharacterCollection : ConcurrentIdObjectCollection { internal void ImportImperatorCharacters( Imperator.World impWorld, ReligionMapper religionMapper, diff --git a/ImperatorToCK3/CK3/Characters/CharactersLoader.cs b/ImperatorToCK3/CK3/Characters/CharactersLoader.cs index 62c05bc13..0b686d6cb 100644 --- a/ImperatorToCK3/CK3/Characters/CharactersLoader.cs +++ b/ImperatorToCK3/CK3/Characters/CharactersLoader.cs @@ -5,7 +5,7 @@ namespace ImperatorToCK3.CK3.Characters; -public sealed partial class CharacterCollection { +internal sealed partial class CharacterCollection { public void LoadCK3Characters(ModFilesystem ck3ModFS, Date bookmarkDate) { Logger.Info("Loading characters from CK3..."); diff --git a/ImperatorToCK3/CK3/Cultures/Culture.cs b/ImperatorToCK3/CK3/Cultures/Culture.cs index 6bc91c65a..7c42d9aa3 100644 --- a/ImperatorToCK3/CK3/Cultures/Culture.cs +++ b/ImperatorToCK3/CK3/Cultures/Culture.cs @@ -12,7 +12,7 @@ namespace ImperatorToCK3.CK3.Cultures; -public sealed class Culture : IIdentifiable, IPDXSerializable { +internal sealed class Culture : IIdentifiable, IPDXSerializable { public string Id { get; } public Color Color { get; } public OrderedSet ParentCultureIds { get; set; } diff --git a/ImperatorToCK3/CK3/Cultures/CultureCollection.cs b/ImperatorToCK3/CK3/Cultures/CultureCollection.cs index a67d4c651..cb3443017 100644 --- a/ImperatorToCK3/CK3/Cultures/CultureCollection.cs +++ b/ImperatorToCK3/CK3/Cultures/CultureCollection.cs @@ -16,7 +16,7 @@ namespace ImperatorToCK3.CK3.Cultures; -public class CultureCollection : IdObjectCollection { +internal class CultureCollection : IdObjectCollection { public CultureCollection(ColorFactory colorFactory, PillarCollection pillarCollection, OrderedDictionary ck3ModFlags) { this.PillarCollection = pillarCollection; InitCultureDataParser(colorFactory, ck3ModFlags); diff --git a/ImperatorToCK3/CK3/Cultures/CultureData.cs b/ImperatorToCK3/CK3/Cultures/CultureData.cs index 6b79bdec9..3f86ca12a 100644 --- a/ImperatorToCK3/CK3/Cultures/CultureData.cs +++ b/ImperatorToCK3/CK3/Cultures/CultureData.cs @@ -5,8 +5,8 @@ namespace ImperatorToCK3.CK3.Cultures; -public record CultureData { - public IEnumerable InvalidatingCultureIds { get; set; } = new List(); +internal record CultureData { + public List InvalidatingCultureIds { get; set; } = []; public Color? Color { get; set; } public OrderedSet ParentCultureIds { get; set; } = new(); public Pillar? Heritage { get; set; } @@ -14,5 +14,5 @@ public record CultureData { public OrderedSet TraditionIds { get; set; } = new(); public OrderedSet NameLists { get; } = new(); - public IList> Attributes { get; } = new List>(); + public List> Attributes { get; } = []; } \ No newline at end of file diff --git a/ImperatorToCK3/CK3/Cultures/Pillar.cs b/ImperatorToCK3/CK3/Cultures/Pillar.cs index 39df08e8a..46979dd93 100644 --- a/ImperatorToCK3/CK3/Cultures/Pillar.cs +++ b/ImperatorToCK3/CK3/Cultures/Pillar.cs @@ -7,7 +7,7 @@ namespace ImperatorToCK3.CK3.Cultures; -public sealed class Pillar : IIdentifiable, IPDXSerializable { +internal sealed class Pillar : IIdentifiable, IPDXSerializable { public string Id { get; } public string Type { get; } public Color? Color { get; } diff --git a/ImperatorToCK3/CK3/Cultures/PillarCollection.cs b/ImperatorToCK3/CK3/Cultures/PillarCollection.cs index a1223e6a2..f21521930 100644 --- a/ImperatorToCK3/CK3/Cultures/PillarCollection.cs +++ b/ImperatorToCK3/CK3/Cultures/PillarCollection.cs @@ -9,7 +9,7 @@ namespace ImperatorToCK3.CK3.Cultures; -public sealed class PillarCollection : IdObjectCollection { +internal sealed class PillarCollection : IdObjectCollection { private readonly Dictionary mergedPillarsDict = []; public PillarCollection(ColorFactory colorFactory, OrderedDictionary ck3ModFlags) { diff --git a/ImperatorToCK3/CK3/Cultures/PillarData.cs b/ImperatorToCK3/CK3/Cultures/PillarData.cs index 7b28cbafb..3023181d2 100644 --- a/ImperatorToCK3/CK3/Cultures/PillarData.cs +++ b/ImperatorToCK3/CK3/Cultures/PillarData.cs @@ -4,10 +4,10 @@ namespace ImperatorToCK3.CK3.Cultures; -public record PillarData { - public IEnumerable InvalidatingPillarIds { get; set; } = new List(); +internal record PillarData { + public List InvalidatingPillarIds { get; set; } = []; public string? Type { get; set; } public Color? Color { get; set; } - - public IList> Attributes { get; } = new List>(); + + public List> Attributes { get; } = []; } \ No newline at end of file diff --git a/ImperatorToCK3/CK3/Dynasties/Dynasty.cs b/ImperatorToCK3/CK3/Dynasties/Dynasty.cs index 2a3af71dd..1b5cf9f06 100644 --- a/ImperatorToCK3/CK3/Dynasties/Dynasty.cs +++ b/ImperatorToCK3/CK3/Dynasties/Dynasty.cs @@ -14,7 +14,7 @@ namespace ImperatorToCK3.CK3.Dynasties; [SerializationByProperties] -public sealed partial class Dynasty : IPDXSerializable, IIdentifiable { +internal sealed partial class Dynasty : IPDXSerializable, IIdentifiable { public Dynasty(Family irFamily, CharacterCollection irCharacters, CulturesDB irCulturesDB, CultureMapper cultureMapper, LocDB irLocDB, CK3LocDB ck3LocDB, Date date) { FromImperator = true; Id = $"dynn_irtock3_{irFamily.Id}"; diff --git a/ImperatorToCK3/CK3/Dynasties/DynastyCollection.cs b/ImperatorToCK3/CK3/Dynasties/DynastyCollection.cs index e372dd136..eb19e53c9 100644 --- a/ImperatorToCK3/CK3/Dynasties/DynastyCollection.cs +++ b/ImperatorToCK3/CK3/Dynasties/DynastyCollection.cs @@ -12,7 +12,7 @@ namespace ImperatorToCK3.CK3.Dynasties; -public sealed class DynastyCollection : ConcurrentIdObjectCollection { +internal sealed class DynastyCollection : ConcurrentIdObjectCollection { public void ImportImperatorFamilies(Imperator.World irWorld, CultureMapper cultureMapper, LocDB irLocDB, CK3LocDB ck3LocDB, Date date) { Logger.Info("Importing Imperator families..."); diff --git a/ImperatorToCK3/CK3/Dynasties/HouseCollection.cs b/ImperatorToCK3/CK3/Dynasties/HouseCollection.cs index bbb90bb27..f2b51ab6b 100644 --- a/ImperatorToCK3/CK3/Dynasties/HouseCollection.cs +++ b/ImperatorToCK3/CK3/Dynasties/HouseCollection.cs @@ -7,7 +7,7 @@ namespace ImperatorToCK3.CK3.Dynasties; -public sealed class HouseCollection : ConcurrentIdObjectCollection { +internal sealed class HouseCollection : ConcurrentIdObjectCollection { public void LoadCK3Houses(ModFilesystem ck3ModFS) { Logger.Info("Loading dynasty houses from CK3..."); diff --git a/ImperatorToCK3/CK3/Provinces/Province.cs b/ImperatorToCK3/CK3/Provinces/Province.cs index 6cc0e17bb..56752f25f 100644 --- a/ImperatorToCK3/CK3/Provinces/Province.cs +++ b/ImperatorToCK3/CK3/Provinces/Province.cs @@ -11,7 +11,7 @@ namespace ImperatorToCK3.CK3.Provinces; -public sealed partial class Province : IIdentifiable { +internal sealed partial class Province : IIdentifiable { public ulong Id { get; } = 0; public ulong? BaseProvinceId { get; private set; } diff --git a/ImperatorToCK3/CK3/Provinces/ProvinceCollection.cs b/ImperatorToCK3/CK3/Provinces/ProvinceCollection.cs index 5ea4e6eb0..80e6a3215 100644 --- a/ImperatorToCK3/CK3/Provinces/ProvinceCollection.cs +++ b/ImperatorToCK3/CK3/Provinces/ProvinceCollection.cs @@ -17,7 +17,7 @@ namespace ImperatorToCK3.CK3.Provinces; -public sealed class ProvinceCollection : IdObjectCollection { +internal sealed class ProvinceCollection : IdObjectCollection { public ProvinceCollection() { } public ProvinceCollection(ModFilesystem ck3ModFs) { LoadProvincesHistory(ck3ModFs); diff --git a/ImperatorToCK3/CK3/Provinces/ProvinceHistory.cs b/ImperatorToCK3/CK3/Provinces/ProvinceHistory.cs index 5cd5b18cf..69bf23ef4 100644 --- a/ImperatorToCK3/CK3/Provinces/ProvinceHistory.cs +++ b/ImperatorToCK3/CK3/Provinces/ProvinceHistory.cs @@ -8,7 +8,7 @@ namespace ImperatorToCK3.CK3.Provinces; -public sealed partial class Province { +internal sealed partial class Province { public string? GetFaithId(Date date) { var historyValue = History.GetFieldValue("faith", date); return historyValue switch { diff --git a/ImperatorToCK3/CK3/Religions/Faith.cs b/ImperatorToCK3/CK3/Religions/Faith.cs index 8510c49fa..8d769b394 100644 --- a/ImperatorToCK3/CK3/Religions/Faith.cs +++ b/ImperatorToCK3/CK3/Religions/Faith.cs @@ -8,7 +8,7 @@ namespace ImperatorToCK3.CK3.Religions; -public sealed class Faith : IIdentifiable, IPDXSerializable { +internal sealed class Faith : IIdentifiable, IPDXSerializable { public string Id { get; } public Religion Religion { get; set; } public Color? Color { get; } diff --git a/ImperatorToCK3/CK3/Religions/FaithData.cs b/ImperatorToCK3/CK3/Religions/FaithData.cs index 6cf70e882..5403f212f 100644 --- a/ImperatorToCK3/CK3/Religions/FaithData.cs +++ b/ImperatorToCK3/CK3/Religions/FaithData.cs @@ -4,12 +4,12 @@ namespace ImperatorToCK3.CK3.Religions; -public record FaithData { - public IEnumerable InvalidatingFaithIds { get; set; } = new List(); +internal record FaithData { + public List InvalidatingFaithIds { get; set; } = []; public Color? Color { get; set; } public string? ReligiousHeadTitleId { get; set; } - public IList DoctrineIds { get; } = new List(); - public IList HolySiteIds { get; init; } = new List(); + public List DoctrineIds { get; } = []; + public List HolySiteIds { get; init; } = []; - public IList> Attributes { get; init; } = new List>(); + public List> Attributes { get; init; } = []; } \ No newline at end of file diff --git a/ImperatorToCK3/CK3/Religions/HolySite.cs b/ImperatorToCK3/CK3/Religions/HolySite.cs index 6e0b8bfb8..2e2654d7e 100644 --- a/ImperatorToCK3/CK3/Religions/HolySite.cs +++ b/ImperatorToCK3/CK3/Religions/HolySite.cs @@ -9,7 +9,7 @@ namespace ImperatorToCK3.CK3.Religions; [SerializationByProperties] -public sealed partial class HolySite : IIdentifiable, IPDXSerializable { +internal sealed partial class HolySite : IIdentifiable, IPDXSerializable { [NonSerialized] public string Id { get; } [NonSerialized] public bool IsFromConverter { get; } [NonSerialized] public Title? County { get; } diff --git a/ImperatorToCK3/CK3/Religions/Religion.cs b/ImperatorToCK3/CK3/Religions/Religion.cs index 3a6089f5b..02bd8712e 100644 --- a/ImperatorToCK3/CK3/Religions/Religion.cs +++ b/ImperatorToCK3/CK3/Religions/Religion.cs @@ -9,7 +9,7 @@ namespace ImperatorToCK3.CK3.Religions; -public sealed class Religion : IIdentifiable, IPDXSerializable { +internal sealed class Religion : IIdentifiable, IPDXSerializable { public string Id { get; } public OrderedSet DoctrineIds { get; } = new(); diff --git a/ImperatorToCK3/CK3/Religions/ReligionCollection.cs b/ImperatorToCK3/CK3/Religions/ReligionCollection.cs index 232379fa7..33a07ece3 100644 --- a/ImperatorToCK3/CK3/Religions/ReligionCollection.cs +++ b/ImperatorToCK3/CK3/Religions/ReligionCollection.cs @@ -15,7 +15,7 @@ namespace ImperatorToCK3.CK3.Religions; -public sealed class ReligionCollection(Title.LandedTitles landedTitles) : IdObjectCollection { +internal sealed class ReligionCollection(Title.LandedTitles landedTitles) : IdObjectCollection { private readonly Dictionary> replaceableHolySitesByFaith = []; public IReadOnlyDictionary> ReplaceableHolySitesByFaith => replaceableHolySitesByFaith; public IdObjectCollection HolySites { get; } = []; diff --git a/ImperatorToCK3/CK3/Titles/LandedTitles.cs b/ImperatorToCK3/CK3/Titles/LandedTitles.cs index 250f83556..d32632e89 100644 --- a/ImperatorToCK3/CK3/Titles/LandedTitles.cs +++ b/ImperatorToCK3/CK3/Titles/LandedTitles.cs @@ -31,7 +31,7 @@ namespace ImperatorToCK3.CK3.Titles; -public sealed partial class Title { +internal sealed partial class Title { private readonly LandedTitles parentCollection; // This is a recursive class that scrapes common/landed_titles looking for title colors, landlessness, diff --git a/ImperatorToCK3/CK3/Titles/RulerTerm.cs b/ImperatorToCK3/CK3/Titles/RulerTerm.cs index 8beda95f5..3f1e37842 100644 --- a/ImperatorToCK3/CK3/Titles/RulerTerm.cs +++ b/ImperatorToCK3/CK3/Titles/RulerTerm.cs @@ -10,7 +10,7 @@ namespace ImperatorToCK3.CK3.Titles; -public sealed class RulerTerm { +internal sealed class RulerTerm { public string? CharacterId { get; } public Date StartDate { get; } public string? Government { get; } diff --git a/ImperatorToCK3/CK3/Titles/Title.cs b/ImperatorToCK3/CK3/Titles/Title.cs index 48e180716..fc195305d 100644 --- a/ImperatorToCK3/CK3/Titles/Title.cs +++ b/ImperatorToCK3/CK3/Titles/Title.cs @@ -34,7 +34,7 @@ namespace ImperatorToCK3.CK3.Titles; [SerializationByProperties] -public sealed partial class Title : IPDXSerializable, IIdentifiable { +internal sealed partial class Title : IPDXSerializable, IIdentifiable { public override string ToString() { return Id; } @@ -721,9 +721,9 @@ public Date GetDateOfLastHolderChange() { return lastDate ?? new Date(1, 1, 1); } - public ISet GetAllHolderIds() { + public HashSet GetAllHolderIds() { if (!History.Fields.TryGetValue("holder", out var holderField)) { - return new HashSet(); + return []; } var ids = new HashSet(); @@ -980,10 +980,10 @@ public void SetDeFactoLiege(Title? newLiege, Date date) { private readonly TitleCollection deJureVassals = []; [SerializeOnlyValue] public IReadOnlyTitleCollection DeJureVassals => deJureVassals; // DIRECT de jure vassals - public IDictionary GetDeJureVassalsAndBelow() { + public Dictionary GetDeJureVassalsAndBelow() { return GetDeJureVassalsAndBelow("bcdke"); } - public IDictionary GetDeJureVassalsAndBelow(string rankFilter) { + public Dictionary GetDeJureVassalsAndBelow(string rankFilter) { var rankFilterAsArray = rankFilter.ToCharArray(); Dictionary deJureVassalsAndBelow = new(); foreach (var vassalTitle in DeJureVassals) { @@ -1003,14 +1003,14 @@ public IDictionary GetDeJureVassalsAndBelow(string rankFilter) { return deJureVassalsAndBelow; } - public IDictionary GetDeFactoVassals(Date date) { // DIRECT de facto vassals + public Dictionary GetDeFactoVassals(Date date) { // DIRECT de facto vassals return parentCollection.Where(t => t.GetDeFactoLiege(date)?.Id == Id) .ToDictionary(t => t.Id, t => t); } - public IDictionary GetDeFactoVassalsAndBelow(Date date) { + public Dictionary GetDeFactoVassalsAndBelow(Date date) { return GetDeFactoVassalsAndBelow(date, "bcdke"); } - public IDictionary GetDeFactoVassalsAndBelow(Date date, string rankFilter) { + public Dictionary GetDeFactoVassalsAndBelow(Date date, string rankFilter) { var rankFilterAsArray = rankFilter.ToCharArray(); Dictionary deFactoVassalsAndBelow = new(); foreach (var (vassalTitleName, vassalTitle) in GetDeFactoVassals(date)) { @@ -1052,9 +1052,9 @@ public IDictionary GetDeFactoVassalsAndBelow(Date date, string ra [SerializedName("always_follows_primary_heir")] public bool? AlwaysFollowsPrimaryHeir { get; set; } [SerializedName("de_jure_drift_disabled")] public bool? DeJureDriftDisabled { get; set; } [SerializedName("can_be_named_after_dynasty")] public bool? CanBeNamedAfterDynasty { get; set; } - [SerializedName("male_names")] public IList? MaleNames { get; private set; } + [SerializedName("male_names")] public List? MaleNames { get; private set; } // - [SerializedName("cultural_names")] public IDictionary? CulturalNames { get; private set; } + [SerializedName("cultural_names")] public Dictionary? CulturalNames { get; private set; } public int? GetOwnOrInheritedDevelopmentLevel(Date date) { var ownDev = GetDevelopmentLevel(date); @@ -1196,7 +1196,7 @@ public async Task OutputHistory(StreamWriter writer) { await writer.WriteAsync(sb); } - public ISet GetProvincesInCountry(Date date) { + public HashSet 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/CK3/Titles/TitleCollection.cs b/ImperatorToCK3/CK3/Titles/TitleCollection.cs index f2897bb6a..c75168b9f 100644 --- a/ImperatorToCK3/CK3/Titles/TitleCollection.cs +++ b/ImperatorToCK3/CK3/Titles/TitleCollection.cs @@ -3,8 +3,8 @@ namespace ImperatorToCK3.CK3.Titles; -public interface IReadOnlyTitleCollection : IReadOnlyCollection<Title> { +internal interface IReadOnlyTitleCollection : IReadOnlyCollection<Title> { public bool ContainsKey(string key); } -public class TitleCollection : IdObjectCollection<string, Title>, IReadOnlyTitleCollection; \ No newline at end of file +internal class TitleCollection : IdObjectCollection<string, Title>, IReadOnlyTitleCollection; \ No newline at end of file diff --git a/ImperatorToCK3/CK3/Titles/TitleHistory.cs b/ImperatorToCK3/CK3/Titles/TitleHistory.cs index 49380fc96..88daf4f60 100644 --- a/ImperatorToCK3/CK3/Titles/TitleHistory.cs +++ b/ImperatorToCK3/CK3/Titles/TitleHistory.cs @@ -2,7 +2,7 @@ namespace ImperatorToCK3.CK3.Titles; -public partial class Title { +internal partial class Title { public string GetHolderId(Date date) { var idFromHistory = History.GetFieldValue("holder", date); if (idFromHistory is not null) { diff --git a/ImperatorToCK3/CK3/Wars/War.cs b/ImperatorToCK3/CK3/Wars/War.cs index 7c21da565..303c2640c 100644 --- a/ImperatorToCK3/CK3/Wars/War.cs +++ b/ImperatorToCK3/CK3/Wars/War.cs @@ -10,13 +10,13 @@ namespace ImperatorToCK3.CK3.Wars; -public sealed class War { +internal sealed class War { public Date StartDate { get; } = "2.1.1"; public Date EndDate { get; } public OrderedSet<string> TargetedTitles { get; } = []; public string? CasusBelli { get; } - public IList<string> Attackers { get; } = []; - public IList<string> Defenders { get; } = []; + public List<string> Attackers { get; } = []; + public List<string> Defenders { get; } = []; public string Claimant { get; } 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) { diff --git a/ImperatorToCK3/CK3/World.cs b/ImperatorToCK3/CK3/World.cs index b1e3d882a..883b91c1a 100644 --- a/ImperatorToCK3/CK3/World.cs +++ b/ImperatorToCK3/CK3/World.cs @@ -31,7 +31,6 @@ using ImperatorToCK3.Mappers.UnitType; using ImperatorToCK3.Outputter; using log4net.Core; -using System; using System.Collections.Generic; using System.Collections.Immutable; using System.IO; @@ -41,7 +40,7 @@ namespace ImperatorToCK3.CK3; -public sealed class World { +internal sealed class World { public OrderedSet<Mod> LoadedMods { get; } public ModFilesystem ModFS { get; } public CK3LocDB LocDB { get; } = []; @@ -57,7 +56,7 @@ public sealed class World { public ReligionCollection Religions { get; } public IdObjectCollection<string, MenAtArmsType> MenAtArmsTypes { get; } = new(); public MapData MapData { get; private set; } = null!; - public IList<Wars.War> Wars { get; } = new List<Wars.War>(); + public List<Wars.War> Wars { get; } = []; public LegendSeedCollection LegendSeeds { get; } = []; internal CoaMapper CK3CoaMapper { get; private set; } = null!; private readonly List<string> enabledDlcFlags = []; diff --git a/ImperatorToCK3/CommonUtils/Genes/AccessoryGene.cs b/ImperatorToCK3/CommonUtils/Genes/AccessoryGene.cs index 05e6a0cbd..36001a55e 100644 --- a/ImperatorToCK3/CommonUtils/Genes/AccessoryGene.cs +++ b/ImperatorToCK3/CommonUtils/Genes/AccessoryGene.cs @@ -4,7 +4,7 @@ namespace ImperatorToCK3.CommonUtils.Genes; -public sealed class AccessoryGene : Gene, IIdentifiable<string> { +internal sealed class AccessoryGene : Gene, IIdentifiable<string> { public string Id { get; } public uint? Index { get; private set; } public IdObjectCollection<string, AccessoryGeneTemplate> GeneTemplates { get; } = []; diff --git a/ImperatorToCK3/CommonUtils/Genes/AccessoryGeneTemplate.cs b/ImperatorToCK3/CommonUtils/Genes/AccessoryGeneTemplate.cs index 090fd66ed..9891a3be8 100644 --- a/ImperatorToCK3/CommonUtils/Genes/AccessoryGeneTemplate.cs +++ b/ImperatorToCK3/CommonUtils/Genes/AccessoryGeneTemplate.cs @@ -4,10 +4,10 @@ namespace ImperatorToCK3.CommonUtils.Genes; -public sealed class AccessoryGeneTemplate : IIdentifiable<string> { +internal sealed class AccessoryGeneTemplate : IIdentifiable<string> { public string Id { get; } public uint Index { get; private set; } = 0; - public IDictionary<string, WeightBlock> AgeSexWeightBlocks { get; } = new Dictionary<string, WeightBlock>(); + public Dictionary<string, WeightBlock> AgeSexWeightBlocks { get; } = []; public AccessoryGeneTemplate(string id, BufferedReader reader) { Id = id; diff --git a/ImperatorToCK3/CommonUtils/Genes/GenesDB.cs b/ImperatorToCK3/CommonUtils/Genes/GenesDB.cs index b8e992bb7..de9db447c 100644 --- a/ImperatorToCK3/CommonUtils/Genes/GenesDB.cs +++ b/ImperatorToCK3/CommonUtils/Genes/GenesDB.cs @@ -4,7 +4,7 @@ namespace ImperatorToCK3.CommonUtils.Genes; -public sealed class GenesDB { +internal sealed class GenesDB { public IdObjectCollection<string, AccessoryGene> AccessoryGenes { get; } = new(); public IdObjectCollection<string, MorphGene> MorphGenes { get; } = new(); public IdObjectCollection<string, AccessoryGene> SpecialAccessoryGenes { get; } = new(); diff --git a/ImperatorToCK3/CommonUtils/Map/MapData.cs b/ImperatorToCK3/CommonUtils/Map/MapData.cs index 9bc83a846..d46bd7f61 100644 --- a/ImperatorToCK3/CommonUtils/Map/MapData.cs +++ b/ImperatorToCK3/CommonUtils/Map/MapData.cs @@ -11,7 +11,7 @@ namespace ImperatorToCK3.CommonUtils.Map; -public sealed class MapData { +internal sealed class MapData { [StructLayout(LayoutKind.Auto)] private struct Point(int x, int y) : IEquatable<Point> { public int X { get; set; } = x; diff --git a/ImperatorToCK3/CommonUtils/Map/ProvinceDefinitions.cs b/ImperatorToCK3/CommonUtils/Map/ProvinceDefinitions.cs index 77aac5f34..7d03072c6 100644 --- a/ImperatorToCK3/CommonUtils/Map/ProvinceDefinitions.cs +++ b/ImperatorToCK3/CommonUtils/Map/ProvinceDefinitions.cs @@ -8,8 +8,8 @@ namespace ImperatorToCK3.CommonUtils.Map; -public sealed class ProvinceDefinitions : IdObjectCollection<ulong, ProvinceDefinition> { - public IDictionary<Rgb24, ulong> ColorToProvinceDict { get; } = new Dictionary<Rgb24, ulong>(); +internal sealed class ProvinceDefinitions : IdObjectCollection<ulong, ProvinceDefinition> { + public Dictionary<Rgb24, ulong> ColorToProvinceDict { get; } = []; public Dictionary<ulong, Rgb24> ProvinceToColorDict { get; } = []; public void LoadDefinitions(string definitionsFilename, ModFilesystem modFS) { diff --git a/ImperatorToCK3/Imperator/Characters/Character.cs b/ImperatorToCK3/Imperator/Characters/Character.cs index fe449f736..22a924beb 100644 --- a/ImperatorToCK3/Imperator/Characters/Character.cs +++ b/ImperatorToCK3/Imperator/Characters/Character.cs @@ -8,11 +8,10 @@ using Open.Collections; using System.Collections.Generic; using System.Collections.Immutable; -using System.Linq; namespace ImperatorToCK3.Imperator.Characters; -public sealed class Character : IIdentifiable<ulong> { +internal sealed class Character : IIdentifiable<ulong> { public Character(ulong id) { Id = id; } @@ -66,11 +65,11 @@ public bool LinkFamily(FamilyCollection families, SortedSet<ulong>? missingDefin public bool IsDead => DeathDate is not null; public string? DeathReason { get; set; } private HashSet<ulong> parsedSpouseIds = []; - public IDictionary<ulong, Character> Spouses { get; set; } = new Dictionary<ulong, Character>(); + public Dictionary<ulong, Character> Spouses { get; set; } = []; public OrderedSet<ulong> FriendIds { get; } = []; public OrderedSet<ulong> RivalIds { get; } = []; private HashSet<ulong> parsedChildrenIds = []; - public IDictionary<ulong, Character> Children { get; set; } = new Dictionary<ulong, Character>(); + public Dictionary<ulong, Character> Children { get; set; } = []; private ulong? parsedMotherId; public Character? Mother { get; set; } private ulong? parsedFatherId; @@ -89,7 +88,7 @@ public Family? Family { } } - public IList<string> Traits { get; set; } = []; + public List<string> Traits { get; set; } = []; public CharacterAttributes Attributes { get; private set; } = new(); public IReadOnlySet<string> Variables { get; private set; } = ImmutableHashSet<string>.Empty; public bool IsBald => Variables.Contains("bald"); diff --git a/ImperatorToCK3/Imperator/Characters/CharacterCollection.cs b/ImperatorToCK3/Imperator/Characters/CharacterCollection.cs index 4e1261955..1fa639a51 100644 --- a/ImperatorToCK3/Imperator/Characters/CharacterCollection.cs +++ b/ImperatorToCK3/Imperator/Characters/CharacterCollection.cs @@ -10,7 +10,7 @@ namespace ImperatorToCK3.Imperator.Characters; -public sealed class CharacterCollection : ConcurrentIdObjectCollection<ulong, Character> { +internal sealed class CharacterCollection : ConcurrentIdObjectCollection<ulong, Character> { public void LoadCharactersFromBloc(BufferedReader reader) { var blocParser = new Parser(); blocParser.RegisterKeyword("character_database", LoadCharacters); diff --git a/ImperatorToCK3/Imperator/Characters/PortraitData.cs b/ImperatorToCK3/Imperator/Characters/PortraitData.cs index dead38833..82ef1d7d0 100644 --- a/ImperatorToCK3/Imperator/Characters/PortraitData.cs +++ b/ImperatorToCK3/Imperator/Characters/PortraitData.cs @@ -6,7 +6,7 @@ namespace ImperatorToCK3.Imperator.Characters; -public sealed class PortraitData { +internal sealed class PortraitData { public PaletteCoordinates HairColorPaletteCoordinates { get; } = new(); public PaletteCoordinates HairColor2PaletteCoordinates { get; } = new(); public PaletteCoordinates SkinColorPaletteCoordinates { get; } = new(); @@ -14,9 +14,8 @@ public sealed class PortraitData { public PaletteCoordinates EyeColorPaletteCoordinates { get; } = new(); public PaletteCoordinates EyeColor2PaletteCoordinates { get; } = new(); - public IDictionary<string, AccessoryGeneData> AccessoryGenesDict { get; } = - new Dictionary<string, AccessoryGeneData>(); - public IDictionary<string, MorphGeneData> MorphGenesDict { get; } = new Dictionary<string, MorphGeneData>(); + public Dictionary<string, AccessoryGeneData> AccessoryGenesDict { get; } = []; + public Dictionary<string, MorphGeneData> MorphGenesDict { get; } = []; public PortraitData(string dnaString, GenesDB genesDB, string ageSexString = "male") { var decodedDnaStr = Convert.FromBase64String(dnaString); diff --git a/ImperatorToCK3/Imperator/Countries/Country.cs b/ImperatorToCK3/Imperator/Countries/Country.cs index c05021675..c3582ddb9 100644 --- a/ImperatorToCK3/Imperator/Countries/Country.cs +++ b/ImperatorToCK3/Imperator/Countries/Country.cs @@ -9,15 +9,15 @@ namespace ImperatorToCK3.Imperator.Countries; -public sealed partial class Country : IIdentifiable<ulong> { +internal sealed partial class Country : IIdentifiable<ulong> { public ulong Id { get; } = 0; public bool PlayerCountry { get; set; } private ulong? monarchId; // >=0 are valid public Character? Monarch { get; private set; } public string? PrimaryCulture { get; private set; } public string? Religion { get; private set; } - public IList<RulerTerm> RulerTerms { get; set; } = []; - public IDictionary<string, int> HistoricalRegnalNumbers { get; private set; } = new Dictionary<string, int>(); + public List<RulerTerm> RulerTerms { get; set; } = []; + public Dictionary<string, int> HistoricalRegnalNumbers { get; private set; } = []; public string Tag { get; private set; } = ""; private string? historicalTag; public string HistoricalTag { @@ -43,7 +43,7 @@ public string HistoricalTag { public Color? Color3 { get; private set; } public CountryCurrencies Currencies { get; private set; } = new(); private readonly HashSet<ulong> parsedFamilyIds = []; - public IDictionary<ulong, Family> Families { get; private set; } = new Dictionary<ulong, Family>(); + public Dictionary<ulong, Family> Families { get; private set; } = []; public IReadOnlySet<string> Variables { get; private set; } = ImmutableHashSet<string>.Empty; private readonly HashSet<Province> ownedProvinces = []; private readonly List<bool> inventionBooleans = []; diff --git a/ImperatorToCK3/Imperator/Countries/CountryCollection.cs b/ImperatorToCK3/Imperator/Countries/CountryCollection.cs index ee02dc2b7..fd0ed9f45 100644 --- a/ImperatorToCK3/Imperator/Countries/CountryCollection.cs +++ b/ImperatorToCK3/Imperator/Countries/CountryCollection.cs @@ -8,7 +8,7 @@ namespace ImperatorToCK3.Imperator.Countries; -public sealed class CountryCollection : ConcurrentIdObjectCollection<ulong, Country> { +internal sealed class CountryCollection : ConcurrentIdObjectCollection<ulong, Country> { public void LoadCountriesFromBloc(BufferedReader reader) { var blocParser = new Parser(); blocParser.RegisterKeyword("country_database", LoadCountries); diff --git a/ImperatorToCK3/Imperator/Countries/CountryFactory.cs b/ImperatorToCK3/Imperator/Countries/CountryFactory.cs index 75542e6fd..a39105d47 100644 --- a/ImperatorToCK3/Imperator/Countries/CountryFactory.cs +++ b/ImperatorToCK3/Imperator/Countries/CountryFactory.cs @@ -8,7 +8,7 @@ namespace ImperatorToCK3.Imperator.Countries; -public sealed partial class Country { +internal sealed partial class Country { private const string monarchyLawRegexStr = "succession_law|monarchy_military_reforms|monarchy_maritime_laws|monarchy_economic_law|monarchy_citizen_law" + "|monarchy_religious_laws|monarchy_legitimacy_laws|monarchy_contract_law|monarchy_divinity_statutes|jewish_monarchy_divinity_statutes|monarchy_subject_laws"; private const string republicLawRegexStr = "republic_military_recruitment_laws_rom|republic_election_reforms_rom|corruption_laws_rom|republican_mediterranean_laws_rom|republican_religious_laws_rom|republic_integration_laws_rom|republic_citizen_laws_rom|republican_land_reforms_rom" + diff --git a/ImperatorToCK3/Imperator/Countries/CountryName.cs b/ImperatorToCK3/Imperator/Countries/CountryName.cs index d787caa96..3b4651ac5 100644 --- a/ImperatorToCK3/Imperator/Countries/CountryName.cs +++ b/ImperatorToCK3/Imperator/Countries/CountryName.cs @@ -5,7 +5,7 @@ namespace ImperatorToCK3.Imperator.Countries; -public sealed class CountryName : ICloneable { +internal sealed class CountryName : ICloneable { public string Name { get; private set; } = ""; private string? adjective; public CountryName? BaseName { get; private set; } diff --git a/ImperatorToCK3/Imperator/Countries/RulerTerm.cs b/ImperatorToCK3/Imperator/Countries/RulerTerm.cs index 3af880913..bca25f8cf 100644 --- a/ImperatorToCK3/Imperator/Countries/RulerTerm.cs +++ b/ImperatorToCK3/Imperator/Countries/RulerTerm.cs @@ -5,7 +5,7 @@ namespace ImperatorToCK3.Imperator.Countries; -public sealed class RulerTerm { +internal sealed class RulerTerm { public sealed class PreImperatorRulerInfo { public string? Name { get; set; } public Date? BirthDate { get; set; } diff --git a/ImperatorToCK3/Imperator/Diplomacy/DiplomacyDB.cs b/ImperatorToCK3/Imperator/Diplomacy/DiplomacyDB.cs index 159988479..5718f10a4 100644 --- a/ImperatorToCK3/Imperator/Diplomacy/DiplomacyDB.cs +++ b/ImperatorToCK3/Imperator/Diplomacy/DiplomacyDB.cs @@ -5,7 +5,7 @@ namespace ImperatorToCK3.Imperator.Diplomacy; -public sealed class DiplomacyDB { +internal sealed class DiplomacyDB { private readonly List<War> wars = []; public IReadOnlyList<War> Wars => wars; diff --git a/ImperatorToCK3/Imperator/Diplomacy/War.cs b/ImperatorToCK3/Imperator/Diplomacy/War.cs index c202a1cf8..a20202f8a 100644 --- a/ImperatorToCK3/Imperator/Diplomacy/War.cs +++ b/ImperatorToCK3/Imperator/Diplomacy/War.cs @@ -4,11 +4,11 @@ namespace ImperatorToCK3.Imperator.Diplomacy; -public sealed class War { +internal sealed class War { public Date StartDate { get; private set; } = new(1, 1, 1); public bool Previous { get; private set; } - public IList<ulong> AttackerCountryIds { get; } = new List<ulong>(); - public IList<ulong> DefenderCountryIds { get; } = new List<ulong>(); + public List<ulong> AttackerCountryIds { get; } = []; + public List<ulong> DefenderCountryIds { get; } = []; public string? WarGoal { get; private set; } public ulong? TargetedStateId { get; private set; } diff --git a/ImperatorToCK3/Imperator/Families/Family.cs b/ImperatorToCK3/Imperator/Families/Family.cs index 29195bb62..d62fb385a 100644 --- a/ImperatorToCK3/Imperator/Families/Family.cs +++ b/ImperatorToCK3/Imperator/Families/Family.cs @@ -7,7 +7,7 @@ namespace ImperatorToCK3.Imperator.Families; -public sealed class Family : IIdentifiable<ulong> { +internal sealed class Family : IIdentifiable<ulong> { public ulong Id { get; } = 0; public string Key { get; private set; } = ""; public string Culture { get; private set; } = ""; diff --git a/ImperatorToCK3/Imperator/Families/FamilyCollection.cs b/ImperatorToCK3/Imperator/Families/FamilyCollection.cs index bee6b43db..3a95cba09 100644 --- a/ImperatorToCK3/Imperator/Families/FamilyCollection.cs +++ b/ImperatorToCK3/Imperator/Families/FamilyCollection.cs @@ -6,7 +6,7 @@ namespace ImperatorToCK3.Imperator.Families; -public sealed class FamilyCollection : IdObjectCollection<ulong, Family> { +internal sealed class FamilyCollection : IdObjectCollection<ulong, Family> { public void LoadFamiliesFromBloc(BufferedReader reader) { var blocParser = new Parser(); blocParser.RegisterKeyword("families", LoadFamilies); diff --git a/ImperatorToCK3/Imperator/Geography/Area.cs b/ImperatorToCK3/Imperator/Geography/Area.cs index ab3aad45e..7f1c27692 100644 --- a/ImperatorToCK3/Imperator/Geography/Area.cs +++ b/ImperatorToCK3/Imperator/Geography/Area.cs @@ -8,7 +8,7 @@ namespace ImperatorToCK3.Imperator.Geography; -public sealed class Area : IIdentifiable<string> { +internal sealed class Area : IIdentifiable<string> { public SortedSet<ulong> ProvinceIds { get; } = new(); public string Id { get; } diff --git a/ImperatorToCK3/Imperator/Geography/AreaCollection.cs b/ImperatorToCK3/Imperator/Geography/AreaCollection.cs index 975e79263..ff3e090a7 100644 --- a/ImperatorToCK3/Imperator/Geography/AreaCollection.cs +++ b/ImperatorToCK3/Imperator/Geography/AreaCollection.cs @@ -6,7 +6,7 @@ namespace ImperatorToCK3.Imperator.Geography; -public sealed class AreaCollection : IdObjectCollection<string, Area> { +internal sealed class AreaCollection : IdObjectCollection<string, Area> { public void LoadAreas(ModFilesystem imperatorModFS, ProvinceCollection provinceCollection) { Logger.Info("Loading Imperator areas..."); diff --git a/ImperatorToCK3/Imperator/Jobs/Governorship.cs b/ImperatorToCK3/Imperator/Jobs/Governorship.cs index 5f80d0bb9..f8b2fb04a 100644 --- a/ImperatorToCK3/Imperator/Jobs/Governorship.cs +++ b/ImperatorToCK3/Imperator/Jobs/Governorship.cs @@ -10,7 +10,7 @@ namespace ImperatorToCK3.Imperator.Jobs; -public sealed class Governorship { +internal sealed class Governorship { public Country Country { get; } public ulong CharacterId { get; private set; } = 0; public Date StartDate { get; private set; } = new(1, 1, 1); diff --git a/ImperatorToCK3/Imperator/Jobs/JobsDB.cs b/ImperatorToCK3/Imperator/Jobs/JobsDB.cs index a3b4c28ea..7bf4099c1 100644 --- a/ImperatorToCK3/Imperator/Jobs/JobsDB.cs +++ b/ImperatorToCK3/Imperator/Jobs/JobsDB.cs @@ -8,9 +8,9 @@ namespace ImperatorToCK3.Imperator.Jobs; -public sealed class JobsDB { - public IList<Governorship> Governorships { get; } = []; - public IList<OfficeJob> OfficeJobs { get; } = []; +internal sealed class JobsDB { + public List<Governorship> Governorships { get; } = []; + public List<OfficeJob> OfficeJobs { get; } = []; public JobsDB() { } public JobsDB(BufferedReader jobsReader, CharacterCollection characters, CountryCollection countries, ImperatorRegionMapper irRegionMapper) { diff --git a/ImperatorToCK3/Imperator/Jobs/OfficeJob.cs b/ImperatorToCK3/Imperator/Jobs/OfficeJob.cs index cd7b049a7..5cbbb8738 100644 --- a/ImperatorToCK3/Imperator/Jobs/OfficeJob.cs +++ b/ImperatorToCK3/Imperator/Jobs/OfficeJob.cs @@ -4,7 +4,7 @@ namespace ImperatorToCK3.Imperator.Jobs; -public class OfficeJob { +internal sealed class OfficeJob { public ulong CountryId { get; } public Character Character { get; } public Date StartDate { get; private set; } = new(1, 1, 1); diff --git a/ImperatorToCK3/Imperator/Provinces/Province.cs b/ImperatorToCK3/Imperator/Provinces/Province.cs index f9bce07ef..2e12f8251 100644 --- a/ImperatorToCK3/Imperator/Provinces/Province.cs +++ b/ImperatorToCK3/Imperator/Provinces/Province.cs @@ -9,7 +9,7 @@ namespace ImperatorToCK3.Imperator.Provinces; public enum ProvinceRank { settlement, city, city_metropolis } -public sealed partial class Province : IIdentifiable<ulong> { +internal sealed partial class Province : IIdentifiable<ulong> { public ulong Id { get; } = 0; public string Name { get; set; } = ""; public string Culture { get; set; } = ""; @@ -17,7 +17,7 @@ public sealed partial class Province : IIdentifiable<ulong> { public State? State { get; private set; } = null; public Country? OwnerCountry { get; set; } public ulong Controller { get; set; } = 0; - public IDictionary<ulong, Pop> Pops { get; } = new Dictionary<ulong, Pop>(); + public Dictionary<ulong, Pop> Pops { get; } = []; public ProvinceRank ProvinceRank { get; set; } = ProvinceRank.settlement; public bool Fort { get; set; } = false; public bool IsHolySite => HolySiteId is not null; diff --git a/ImperatorToCK3/Imperator/Provinces/ProvinceCollection.cs b/ImperatorToCK3/Imperator/Provinces/ProvinceCollection.cs index 68679c648..ed012b4b5 100644 --- a/ImperatorToCK3/Imperator/Provinces/ProvinceCollection.cs +++ b/ImperatorToCK3/Imperator/Provinces/ProvinceCollection.cs @@ -7,7 +7,7 @@ namespace ImperatorToCK3.Imperator.Provinces; -public sealed class ProvinceCollection : IdObjectCollection<ulong, Province> { +internal sealed class ProvinceCollection : IdObjectCollection<ulong, Province> { public void LoadProvinces(BufferedReader provincesReader, StateCollection states, CountryCollection countries) { var parser = new Parser(); parser.RegisterRegex(CommonRegexes.Integer, (reader, provIdStr) => { diff --git a/ImperatorToCK3/Imperator/Provinces/ProvinceFactory.cs b/ImperatorToCK3/Imperator/Provinces/ProvinceFactory.cs index 4dd9aba8f..7cd73c8d9 100644 --- a/ImperatorToCK3/Imperator/Provinces/ProvinceFactory.cs +++ b/ImperatorToCK3/Imperator/Provinces/ProvinceFactory.cs @@ -6,7 +6,7 @@ namespace ImperatorToCK3.Imperator.Provinces; -public partial class Province { +internal partial class Province { public static IgnoredKeywordsSet IgnoredTokens { get; } = new(); static Province() { provinceParser.RegisterKeyword("province_name", reader => diff --git a/ImperatorToCK3/Imperator/States/State.cs b/ImperatorToCK3/Imperator/States/State.cs index 2c9def910..ab1fc6d15 100644 --- a/ImperatorToCK3/Imperator/States/State.cs +++ b/ImperatorToCK3/Imperator/States/State.cs @@ -7,7 +7,7 @@ namespace ImperatorToCK3.Imperator.States; -public sealed class State : IIdentifiable<ulong> { +internal sealed class State : IIdentifiable<ulong> { public ulong Id { get; } private readonly ulong capitalProvinceId; public Area Area { get; } diff --git a/ImperatorToCK3/Imperator/States/StateCollection.cs b/ImperatorToCK3/Imperator/States/StateCollection.cs index 178eabaf7..6acefb893 100644 --- a/ImperatorToCK3/Imperator/States/StateCollection.cs +++ b/ImperatorToCK3/Imperator/States/StateCollection.cs @@ -6,7 +6,7 @@ namespace ImperatorToCK3.Imperator.States; -public sealed class StateCollection : IdObjectCollection<ulong, State> { +internal sealed class StateCollection : IdObjectCollection<ulong, State> { public void LoadStates(BufferedReader statesDbReader, IdObjectCollection<string, Area> areas, CountryCollection countries) { stateDataParser.RegisterKeyword("capital", reader => stateData.CapitalProvinceId = reader.GetULong()); stateDataParser.RegisterKeyword("area", reader => { diff --git a/ImperatorToCK3/Imperator/States/StateData.cs b/ImperatorToCK3/Imperator/States/StateData.cs index d83fb0df1..6c1f0b10e 100644 --- a/ImperatorToCK3/Imperator/States/StateData.cs +++ b/ImperatorToCK3/Imperator/States/StateData.cs @@ -3,7 +3,7 @@ namespace ImperatorToCK3.Imperator.States; -public record StateData { +internal record StateData { public ulong CapitalProvinceId { get; set; } public Area? Area { get; set; } public Country? Country { get; set; } diff --git a/ImperatorToCK3/Imperator/World.cs b/ImperatorToCK3/Imperator/World.cs index e7736d238..e53b10e67 100644 --- a/ImperatorToCK3/Imperator/World.cs +++ b/ImperatorToCK3/Imperator/World.cs @@ -36,7 +36,7 @@ namespace ImperatorToCK3.Imperator; -public partial class World { +internal partial class World { public Date EndDate { get; private set; } = new Date("727.2.17", AUC: true); private readonly IList<string> incomingModPaths = []; // List of all mods used in the save. public ModFilesystem ModFS { get; private set; } diff --git a/ImperatorToCK3/Mappers/Culture/CultureMapper.cs b/ImperatorToCK3/Mappers/Culture/CultureMapper.cs index c19cd2d9a..2a348e1e6 100644 --- a/ImperatorToCK3/Mappers/Culture/CultureMapper.cs +++ b/ImperatorToCK3/Mappers/Culture/CultureMapper.cs @@ -6,7 +6,7 @@ namespace ImperatorToCK3.Mappers.Culture; -public sealed class CultureMapper { +internal sealed class CultureMapper { public CultureMapper(ImperatorRegionMapper irRegionMapper, CK3RegionMapper ck3RegionMapper, CultureCollection cultures) { this.irRegionMapper = irRegionMapper; this.ck3RegionMapper = ck3RegionMapper; diff --git a/ImperatorToCK3/Mappers/Culture/CultureMappingRule.cs b/ImperatorToCK3/Mappers/Culture/CultureMappingRule.cs index fbf268ba1..0835f87f3 100644 --- a/ImperatorToCK3/Mappers/Culture/CultureMappingRule.cs +++ b/ImperatorToCK3/Mappers/Culture/CultureMappingRule.cs @@ -4,7 +4,7 @@ namespace ImperatorToCK3.Mappers.Culture; -public sealed class CultureMappingRule { +internal sealed class CultureMappingRule { public static CultureMappingRule Parse(BufferedReader reader) { mappingToReturn = new CultureMappingRule(); parser.ParseStream(reader); diff --git a/ImperatorToCK3/Mappers/Gene/AccessoryGeneMapper.cs b/ImperatorToCK3/Mappers/Gene/AccessoryGeneMapper.cs index 4dd5165ca..758f82d95 100644 --- a/ImperatorToCK3/Mappers/Gene/AccessoryGeneMapper.cs +++ b/ImperatorToCK3/Mappers/Gene/AccessoryGeneMapper.cs @@ -6,8 +6,8 @@ namespace ImperatorToCK3.Mappers.Gene; public sealed class AccessoryGeneMapper { - private Dictionary<string, IList<Assignment>> ObjectToObjectMappings { get; } = []; - private Dictionary<string, IList<Assignment>> TemplateToTemplateMappings { get; } = []; + private Dictionary<string, List<Assignment>> ObjectToObjectMappings { get; } = []; + private Dictionary<string, List<Assignment>> TemplateToTemplateMappings { get; } = []; public AccessoryGeneMapper(string mappingsFilePath) { var objectToObjectMappingsParser = new Parser(); diff --git a/ImperatorToCK3/Mappers/Province/ProvinceMapper.cs b/ImperatorToCK3/Mappers/Province/ProvinceMapper.cs index c33a33bb3..d4bc88400 100644 --- a/ImperatorToCK3/Mappers/Province/ProvinceMapper.cs +++ b/ImperatorToCK3/Mappers/Province/ProvinceMapper.cs @@ -4,9 +4,9 @@ namespace ImperatorToCK3.Mappers.Province; -public sealed class ProvinceMapper { - private readonly Dictionary<ulong, IList<ulong>> imperatorToCK3ProvinceMap = new(); - private readonly Dictionary<ulong, IList<ulong>> ck3ToImperatorProvinceMap = new(); +internal sealed class ProvinceMapper { + private readonly Dictionary<ulong, List<ulong>> imperatorToCK3ProvinceMap = []; + private readonly Dictionary<ulong, List<ulong>> ck3ToImperatorProvinceMap = []; public void LoadMappings(string mappingsPath) { Logger.Info("Loading province mappings..."); @@ -50,17 +50,17 @@ private void CreateMappings(ProvinceMappingsVersion mappingsVersion) { } } - public IList<ulong> GetImperatorProvinceNumbers(ulong ck3ProvinceNumber) { + public List<ulong> GetImperatorProvinceNumbers(ulong ck3ProvinceNumber) { if (ck3ToImperatorProvinceMap.TryGetValue(ck3ProvinceNumber, out var impProvs)) { return impProvs; } - return new List<ulong>(); + return []; } - public IList<ulong> GetCK3ProvinceNumbers(ulong impProvinceNumber) { + public List<ulong> GetCK3ProvinceNumbers(ulong impProvinceNumber) { if (imperatorToCK3ProvinceMap.TryGetValue(impProvinceNumber, out var ck3Provs)) { return ck3Provs; } - return new List<ulong>(); + return []; } } \ No newline at end of file diff --git a/ImperatorToCK3/Mappers/Province/ProvinceMapping.cs b/ImperatorToCK3/Mappers/Province/ProvinceMapping.cs index 9a8cbcf49..45a72fb2e 100644 --- a/ImperatorToCK3/Mappers/Province/ProvinceMapping.cs +++ b/ImperatorToCK3/Mappers/Province/ProvinceMapping.cs @@ -4,8 +4,8 @@ namespace ImperatorToCK3.Mappers.Province; internal sealed class ProvinceMapping { - public IList<ulong> CK3Provinces { get; } = new List<ulong>(); - public IList<ulong> ImperatorProvinces { get; } = new List<ulong>(); + public List<ulong> CK3Provinces { get; } = []; + public List<ulong> ImperatorProvinces { get; } = []; private static readonly Parser parser = new(); private static ProvinceMapping tempMapping = new(); diff --git a/ImperatorToCK3/Mappers/Province/ProvinceMappingsVersion.cs b/ImperatorToCK3/Mappers/Province/ProvinceMappingsVersion.cs index 15aae8ee0..e3ececff0 100644 --- a/ImperatorToCK3/Mappers/Province/ProvinceMappingsVersion.cs +++ b/ImperatorToCK3/Mappers/Province/ProvinceMappingsVersion.cs @@ -5,7 +5,7 @@ namespace ImperatorToCK3.Mappers.Province; internal sealed class ProvinceMappingsVersion { - public IList<ProvinceMapping> Mappings { get; } = []; + public List<ProvinceMapping> Mappings { get; } = []; public ProvinceMappingsVersion() { } public ProvinceMappingsVersion(BufferedReader reader) { var referencedImperatorProvs = new HashSet<ulong>(); diff --git a/ImperatorToCK3/Mappers/Region/CK3Region.cs b/ImperatorToCK3/Mappers/Region/CK3Region.cs index b49e81b8f..198a3be5e 100644 --- a/ImperatorToCK3/Mappers/Region/CK3Region.cs +++ b/ImperatorToCK3/Mappers/Region/CK3Region.cs @@ -5,7 +5,7 @@ namespace ImperatorToCK3.Mappers.Region; -public sealed class CK3Region { +internal sealed class CK3Region { public string Name { get; } private readonly HashSet<string> parsedRegionIds = new(); public Dictionary<string, CK3Region> Regions { get; } = new(); diff --git a/ImperatorToCK3/Mappers/Region/CK3RegionMapper.cs b/ImperatorToCK3/Mappers/Region/CK3RegionMapper.cs index cddd29f90..0ac82809c 100644 --- a/ImperatorToCK3/Mappers/Region/CK3RegionMapper.cs +++ b/ImperatorToCK3/Mappers/Region/CK3RegionMapper.cs @@ -7,7 +7,7 @@ namespace ImperatorToCK3.Mappers.Region; -public sealed class CK3RegionMapper { +internal sealed class CK3RegionMapper { public CK3RegionMapper() { } public CK3RegionMapper(ModFilesystem ck3ModFS, Title.LandedTitles landedTitles) { Logger.Info("Initializing Geography..."); diff --git a/ImperatorToCK3/Mappers/Region/ImperatorRegion.cs b/ImperatorToCK3/Mappers/Region/ImperatorRegion.cs index ee4397e09..f552e6b1a 100644 --- a/ImperatorToCK3/Mappers/Region/ImperatorRegion.cs +++ b/ImperatorToCK3/Mappers/Region/ImperatorRegion.cs @@ -8,7 +8,7 @@ namespace ImperatorToCK3.Mappers.Region; -public sealed class ImperatorRegion : IIdentifiable<string> { +internal sealed class ImperatorRegion : IIdentifiable<string> { public IdObjectCollection<string, Area> Areas { get; } = []; public string Id { get; } public Color? Color { get; private set; } diff --git a/ImperatorToCK3/Mappers/Region/ImperatorRegionMapper.cs b/ImperatorToCK3/Mappers/Region/ImperatorRegionMapper.cs index 1ae111d59..d5a7b73ce 100644 --- a/ImperatorToCK3/Mappers/Region/ImperatorRegionMapper.cs +++ b/ImperatorToCK3/Mappers/Region/ImperatorRegionMapper.cs @@ -7,7 +7,7 @@ namespace ImperatorToCK3.Mappers.Region; -public sealed class ImperatorRegionMapper(AreaCollection areaCollection, MapData irMapData) { +internal sealed class ImperatorRegionMapper(AreaCollection areaCollection, MapData irMapData) { public IdObjectCollection<string, ImperatorRegion> Regions { get; } = []; public void LoadRegions(ModFilesystem imperatorModFS, ColorFactory colorFactory) { diff --git a/ImperatorToCK3/Mappers/Religion/ReligionMapper.cs b/ImperatorToCK3/Mappers/Religion/ReligionMapper.cs index 5a784da2e..06b8f297e 100644 --- a/ImperatorToCK3/Mappers/Religion/ReligionMapper.cs +++ b/ImperatorToCK3/Mappers/Religion/ReligionMapper.cs @@ -7,7 +7,7 @@ namespace ImperatorToCK3.Mappers.Religion; -public sealed class ReligionMapper { +internal sealed class ReligionMapper { public ReligionMapper(ReligionCollection ck3Religions, ImperatorRegionMapper imperatorRegionMapper, CK3RegionMapper ck3RegionMapper) { this.imperatorRegionMapper = imperatorRegionMapper; this.ck3RegionMapper = ck3RegionMapper; diff --git a/ImperatorToCK3/Mappers/TagTitle/TagTitleMapper.cs b/ImperatorToCK3/Mappers/TagTitle/TagTitleMapper.cs index 950b553ff..dd9dccfdc 100644 --- a/ImperatorToCK3/Mappers/TagTitle/TagTitleMapper.cs +++ b/ImperatorToCK3/Mappers/TagTitle/TagTitleMapper.cs @@ -13,7 +13,7 @@ namespace ImperatorToCK3.Mappers.TagTitle; -public sealed class TagTitleMapper { +internal sealed class TagTitleMapper { public TagTitleMapper() { } public TagTitleMapper(string tagTitleMappingsPath, string governorshipTitleMappingsPath, string rankMappingsPath) { Logger.Info("Parsing title mappings..."); diff --git a/ImperatorToCK3/Mappers/Technology/InnovationMapper.cs b/ImperatorToCK3/Mappers/Technology/InnovationMapper.cs index 36add7ff8..cffff186f 100644 --- a/ImperatorToCK3/Mappers/Technology/InnovationMapper.cs +++ b/ImperatorToCK3/Mappers/Technology/InnovationMapper.cs @@ -6,7 +6,7 @@ namespace ImperatorToCK3.Mappers.Technology; -public sealed class InnovationMapper { +internal sealed class InnovationMapper { private readonly List<InnovationLink> innovationLinks = []; private readonly List<InnovationBonus> innovationBonuses = []; @@ -18,7 +18,7 @@ public void LoadLinksAndBonuses(string configurablePath) { parser.ParseFile(configurablePath); } - public IList<string> GetInnovations(IEnumerable<string> irInventions) { + public List<string> GetInnovations(IEnumerable<string> irInventions) { var ck3Innovations = new List<string>(); foreach (var irInvention in irInventions) { foreach (var link in innovationLinks) { @@ -31,7 +31,7 @@ public IList<string> GetInnovations(IEnumerable<string> irInventions) { return ck3Innovations; } - public IDictionary<string, ushort> GetInnovationProgresses(ICollection<string> irInventions) { + public Dictionary<string, ushort> GetInnovationProgresses(ICollection<string> irInventions) { Dictionary<string, ushort> progressesToReturn = []; foreach (var bonus in innovationBonuses) { var innovationProgress = bonus.GetProgress(irInventions); diff --git a/ImperatorToCK3/Outputter/BookmarkOutputter.cs b/ImperatorToCK3/Outputter/BookmarkOutputter.cs index eea3f6c94..c98a52cf1 100644 --- a/ImperatorToCK3/Outputter/BookmarkOutputter.cs +++ b/ImperatorToCK3/Outputter/BookmarkOutputter.cs @@ -19,7 +19,7 @@ namespace ImperatorToCK3.Outputter; -public static class BookmarkOutputter { +internal static class BookmarkOutputter { public static async Task OutputBookmark(World world, Configuration config, CK3LocDB ck3LocDB) { Logger.Info("Creating bookmark..."); diff --git a/ImperatorToCK3/Outputter/CharacterOutputter.cs b/ImperatorToCK3/Outputter/CharacterOutputter.cs index 78e268352..de4341949 100644 --- a/ImperatorToCK3/Outputter/CharacterOutputter.cs +++ b/ImperatorToCK3/Outputter/CharacterOutputter.cs @@ -5,7 +5,7 @@ using Character = ImperatorToCK3.CK3.Characters.Character; namespace ImperatorToCK3.Outputter; -public static class CharacterOutputter { +internal static class CharacterOutputter { public static void WriteCharacter(StringBuilder sb, Character character, Date conversionDate, Date ck3BookmarkDate) { // Output ID. sb.AppendLine($"{character.Id}={{"); diff --git a/ImperatorToCK3/Outputter/CharactersOutputter.cs b/ImperatorToCK3/Outputter/CharactersOutputter.cs index fd2c5103f..383438a96 100644 --- a/ImperatorToCK3/Outputter/CharactersOutputter.cs +++ b/ImperatorToCK3/Outputter/CharactersOutputter.cs @@ -12,7 +12,7 @@ namespace ImperatorToCK3.Outputter; -public static class CharactersOutputter { +internal static class CharactersOutputter { public static async Task OutputEverything(string outputPath, CharacterCollection characters, Date conversionDate, Date ck3BookmarkDate, ModFilesystem ck3ModFS) { await Task.WhenAll( OutputCharacters(outputPath, characters, conversionDate, ck3BookmarkDate, ck3ModFS), diff --git a/ImperatorToCK3/Outputter/CulturesOutputter.cs b/ImperatorToCK3/Outputter/CulturesOutputter.cs index b524994a5..f1f62d6dd 100644 --- a/ImperatorToCK3/Outputter/CulturesOutputter.cs +++ b/ImperatorToCK3/Outputter/CulturesOutputter.cs @@ -16,7 +16,7 @@ namespace ImperatorToCK3.Outputter; -public static class CulturesOutputter { +internal static class CulturesOutputter { public static async Task OutputCultures(string outputModPath, CultureCollection cultures, ModFilesystem ck3ModFS, Configuration config, Date date) { Logger.Info("Outputting cultures..."); diff --git a/ImperatorToCK3/Outputter/DynastiesOutputter.cs b/ImperatorToCK3/Outputter/DynastiesOutputter.cs index adf1ea29e..efd9048fd 100644 --- a/ImperatorToCK3/Outputter/DynastiesOutputter.cs +++ b/ImperatorToCK3/Outputter/DynastiesOutputter.cs @@ -9,7 +9,7 @@ namespace ImperatorToCK3.Outputter; -public static class DynastiesOutputter { +internal static class DynastiesOutputter { public static async Task OutputDynasties(string outputModPath, DynastyCollection dynasties) { Logger.Info("Writing dynasties..."); diff --git a/ImperatorToCK3/Outputter/LocalizationOutputter.cs b/ImperatorToCK3/Outputter/LocalizationOutputter.cs index ae88ec120..ec2e282f3 100644 --- a/ImperatorToCK3/Outputter/LocalizationOutputter.cs +++ b/ImperatorToCK3/Outputter/LocalizationOutputter.cs @@ -7,7 +7,7 @@ using System.Text; namespace ImperatorToCK3.Outputter; -public static class LocalizationOutputter { +internal static class LocalizationOutputter { public static void OutputLocalization(string outputModPath, World ck3World) { Logger.Info("Writing Localization..."); var baseLocDir = Path.Join(outputModPath, "localization"); diff --git a/ImperatorToCK3/Outputter/MenAtArmsOutputter.cs b/ImperatorToCK3/Outputter/MenAtArmsOutputter.cs index 0bddf411f..4d66e7d87 100644 --- a/ImperatorToCK3/Outputter/MenAtArmsOutputter.cs +++ b/ImperatorToCK3/Outputter/MenAtArmsOutputter.cs @@ -12,7 +12,7 @@ namespace ImperatorToCK3.Outputter; -public static class MenAtArmsOutputter { +internal static class MenAtArmsOutputter { private static void OutputHiddenEvent(string outputModName, IEnumerable<Character> charactersWithMaa) { var sb = new StringBuilder(); diff --git a/ImperatorToCK3/Outputter/PillarOutputter.cs b/ImperatorToCK3/Outputter/PillarOutputter.cs index 458a89e5c..3b2a18eca 100644 --- a/ImperatorToCK3/Outputter/PillarOutputter.cs +++ b/ImperatorToCK3/Outputter/PillarOutputter.cs @@ -7,7 +7,7 @@ namespace ImperatorToCK3.Outputter; -public static class PillarOutputter { +internal static class PillarOutputter { public static async Task OutputPillars(string outputPath, PillarCollection pillars) { Logger.Info("Outputting pillars..."); diff --git a/ImperatorToCK3/Outputter/ProvinceOutputter.cs b/ImperatorToCK3/Outputter/ProvinceOutputter.cs index a37b3932d..ce497524a 100644 --- a/ImperatorToCK3/Outputter/ProvinceOutputter.cs +++ b/ImperatorToCK3/Outputter/ProvinceOutputter.cs @@ -4,7 +4,7 @@ namespace ImperatorToCK3.Outputter; -public static class ProvinceOutputter { +internal static class ProvinceOutputter { public static void WriteProvince(StringBuilder sb, Province province, bool isCountyCapital) { // If the province is not a county capital, remove the "culture" and "faith" fields. if (!isCountyCapital) { diff --git a/ImperatorToCK3/Outputter/ProvincesOutputter.cs b/ImperatorToCK3/Outputter/ProvincesOutputter.cs index 7febd3955..189033b11 100644 --- a/ImperatorToCK3/Outputter/ProvincesOutputter.cs +++ b/ImperatorToCK3/Outputter/ProvincesOutputter.cs @@ -10,7 +10,7 @@ namespace ImperatorToCK3.Outputter; -public static class ProvincesOutputter { +internal static class ProvincesOutputter { public static async Task OutputProvinces( string outputModPath, ProvinceCollection provinces, diff --git a/ImperatorToCK3/Outputter/ReligionsOutputter.cs b/ImperatorToCK3/Outputter/ReligionsOutputter.cs index 927bb1fb0..6c67023da 100644 --- a/ImperatorToCK3/Outputter/ReligionsOutputter.cs +++ b/ImperatorToCK3/Outputter/ReligionsOutputter.cs @@ -10,7 +10,7 @@ namespace ImperatorToCK3.Outputter; -public static class ReligionsOutputter { +internal static class ReligionsOutputter { public static async Task OutputReligionsAndHolySites(string outputModPath, ReligionCollection ck3ReligionCollection, CK3LocDB ck3LocDB) { await Task.WhenAll( OutputHolySites(outputModPath, ck3ReligionCollection, ck3LocDB), diff --git a/ImperatorToCK3/Outputter/SuccessionTriggersOutputter.cs b/ImperatorToCK3/Outputter/SuccessionTriggersOutputter.cs index 22aee267a..e50a3fdab 100644 --- a/ImperatorToCK3/Outputter/SuccessionTriggersOutputter.cs +++ b/ImperatorToCK3/Outputter/SuccessionTriggersOutputter.cs @@ -8,7 +8,7 @@ namespace ImperatorToCK3.Outputter; -public static class SuccessionTriggersOutputter { +internal static class SuccessionTriggersOutputter { public static async Task OutputSuccessionTriggers(string outputModPath, Title.LandedTitles landedTitles, Date ck3BookmarkDate) { Logger.Info("Writing Succession Triggers..."); diff --git a/ImperatorToCK3/Outputter/TitlesOutputter.cs b/ImperatorToCK3/Outputter/TitlesOutputter.cs index 3dc2919cf..5ca3b8c9f 100644 --- a/ImperatorToCK3/Outputter/TitlesOutputter.cs +++ b/ImperatorToCK3/Outputter/TitlesOutputter.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; namespace ImperatorToCK3.Outputter; -public static class TitlesOutputter { +internal static class TitlesOutputter { private static async Task OutputTitlesHistory(string outputModPath, Title.LandedTitles titles) { //output title history var alreadyOutputtedTitles = new HashSet<string>(); diff --git a/ImperatorToCK3/Outputter/WarsOutputter.cs b/ImperatorToCK3/Outputter/WarsOutputter.cs index 5bf22a838..9cb5f49f0 100644 --- a/ImperatorToCK3/Outputter/WarsOutputter.cs +++ b/ImperatorToCK3/Outputter/WarsOutputter.cs @@ -8,7 +8,7 @@ namespace ImperatorToCK3.Outputter; -public static class WarsOutputter { +internal static class WarsOutputter { public static async Task OutputWars(string outputModPath, IEnumerable<War> wars) { Logger.Info("Writing wars..."); diff --git a/ImperatorToCK3/Outputter/WorldOutputter.cs b/ImperatorToCK3/Outputter/WorldOutputter.cs index 0b96f93f3..9e1b84968 100644 --- a/ImperatorToCK3/Outputter/WorldOutputter.cs +++ b/ImperatorToCK3/Outputter/WorldOutputter.cs @@ -17,7 +17,7 @@ namespace ImperatorToCK3.Outputter; -public static class WorldOutputter { +internal static class WorldOutputter { public static void OutputWorld(World ck3World, Imperator.World imperatorWorld, Configuration config) { var outputName = config.OutputModName; var outputPath = Path.Combine("output", config.OutputModName);