From 1116393e711effca0752deda9c1b1c0a80d44eda Mon Sep 17 00:00:00 2001 From: iht Date: Sat, 13 Sep 2025 00:30:21 +0200 Subject: [PATCH 1/2] Change public classes to internal across codebase --- .github/workflows/create_release.yml | 4 ++-- ImperatorToCK3/CK3/Armies/MenAtArmsCost.cs | 2 +- ImperatorToCK3/CK3/Characters/Pregnancy.cs | 2 +- ImperatorToCK3/CK3/Cultures/NameList.cs | 4 ++-- ImperatorToCK3/CK3/Dynasties/House.cs | 2 +- ImperatorToCK3/CK3/Legends/LegendSeed.cs | 2 +- ImperatorToCK3/CK3/Legends/LegendSeedCollection.cs | 2 +- ImperatorToCK3/CK3/Provinces/ProvinceMappings.cs | 2 +- ImperatorToCK3/CK3/Religions/DoctrineCategory.cs | 6 +++--- ImperatorToCK3/CK3/Titles/LandedTitles.cs | 2 +- ImperatorToCK3/CommonUtils/ConcurrentIgnoredKeywordsSet.cs | 2 +- ImperatorToCK3/CommonUtils/FieldValue.cs | 2 +- ImperatorToCK3/CommonUtils/Genes/MorphGene.cs | 2 +- ImperatorToCK3/CommonUtils/Genes/MorphGeneTemplate.cs | 2 +- ImperatorToCK3/CommonUtils/Genes/WeightBlock.cs | 2 +- ImperatorToCK3/CommonUtils/HistoryFactory.cs | 2 +- ImperatorToCK3/CommonUtils/IgnoredKeywordsSet.cs | 2 +- ImperatorToCK3/CommonUtils/Map/ProvinceDefinition.cs | 2 +- ImperatorToCK3/CommonUtils/Map/ProvincePosition.cs | 2 +- ImperatorToCK3/CommonUtils/SimpleFieldDef.cs | 4 ++-- ImperatorToCK3/Configuration.cs | 4 ++-- ImperatorToCK3/Imperator/Armies/Subunit.cs | 2 +- ImperatorToCK3/Imperator/Characters/CharacterAttributes.cs | 2 +- ImperatorToCK3/Imperator/Characters/CharacterName.cs | 2 +- ImperatorToCK3/Imperator/Characters/PaletteCoordinates.cs | 2 +- ImperatorToCK3/Imperator/Characters/Unborn.cs | 2 +- ImperatorToCK3/Imperator/Countries/CountryCurrencies.cs | 2 +- ImperatorToCK3/Imperator/Countries/RulerTerm.cs | 2 +- ImperatorToCK3/Imperator/Cultures/Culture.cs | 2 +- ImperatorToCK3/Imperator/Cultures/CultureGroup.cs | 2 +- ImperatorToCK3/Imperator/Cultures/CulturesDB.cs | 2 +- ImperatorToCK3/Imperator/Defines.cs | 2 +- ImperatorToCK3/Imperator/Diplomacy/Dependency.cs | 2 +- ImperatorToCK3/Imperator/Inventions/InventionsDB.cs | 2 +- ImperatorToCK3/Imperator/Pops/Pop.cs | 2 +- ImperatorToCK3/Imperator/Pops/PopCollection.cs | 2 +- ImperatorToCK3/Imperator/Provinces/ProvinceName.cs | 2 +- ImperatorToCK3/Imperator/Religions/Deity.cs | 2 +- ImperatorToCK3/Imperator/Religions/Religion.cs | 2 +- ImperatorToCK3/Imperator/Religions/ReligionCollection.cs | 2 +- ImperatorToCK3/Mappers/DeathReason/DeathReasonMapper.cs | 2 +- ImperatorToCK3/Mappers/Gene/AccessoryGeneMapper.cs | 2 +- ImperatorToCK3/Mappers/Gene/MorphGeneTemplateMapper.cs | 2 +- .../Mappers/HolySiteEffect/HolySiteEffectMapper.cs | 2 +- ImperatorToCK3/Mappers/Nickname/NicknameMapper.cs | 2 +- ImperatorToCK3/Mappers/SuccessionLaw/SuccessionLawMapper.cs | 2 +- ImperatorToCK3/Mappers/TagTitle/DefiniteFormMapper.cs | 2 +- ImperatorToCK3/Mappers/Technology/InnovationBonus.cs | 2 +- ImperatorToCK3/Mappers/Technology/InnovationLink.cs | 2 +- ImperatorToCK3/Mappers/War/WarMapper.cs | 2 +- ImperatorToCK3/Outputter/FileTweaker.cs | 2 +- ImperatorToCK3/Outputter/OnActionOutputter.cs | 4 ++-- 52 files changed, 59 insertions(+), 59 deletions(-) diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index ad226d8e9..51ef072d4 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -112,10 +112,10 @@ jobs: run: | dotnet tool install --global dotnet-innosetup --version 6.2.1 cp Fronter.NET/Fronter.NET/Assets/converter.ico Publish/Assets/ - dotnet iscc --version + iscc --version sed -i '5i\\#define MyAppVersion "${{ needs.create_release.outputs.tag }}"' ImperatorToCK3.iss cat ImperatorToCK3.iss - dotnet iscc ImperatorToCK3.iss + iscc ImperatorToCK3.iss - name: "Upload installer for Windows" id: upload-installer if: matrix.build == 'win-x64' diff --git a/ImperatorToCK3/CK3/Armies/MenAtArmsCost.cs b/ImperatorToCK3/CK3/Armies/MenAtArmsCost.cs index 7ab5a4e12..4dbc75863 100644 --- a/ImperatorToCK3/CK3/Armies/MenAtArmsCost.cs +++ b/ImperatorToCK3/CK3/Armies/MenAtArmsCost.cs @@ -5,7 +5,7 @@ namespace ImperatorToCK3.CK3.Armies; [SerializationByProperties] -public sealed partial class MenAtArmsCost : IPDXSerializable { +internal sealed partial class MenAtArmsCost : IPDXSerializable { [SerializedName("gold")] public double? Gold { get; set; } [SerializedName("piety")] public double? Piety { get; set; } [SerializedName("prestige")] public double? Prestige { get; set; } diff --git a/ImperatorToCK3/CK3/Characters/Pregnancy.cs b/ImperatorToCK3/CK3/Characters/Pregnancy.cs index ab1f29fa8..c58768c07 100644 --- a/ImperatorToCK3/CK3/Characters/Pregnancy.cs +++ b/ImperatorToCK3/CK3/Characters/Pregnancy.cs @@ -2,7 +2,7 @@ namespace ImperatorToCK3.CK3.Characters; -public sealed class Pregnancy { +internal sealed class Pregnancy { public string FatherId { get; init; } public string MotherId { get; init; } public Date BirthDate { get; init; } diff --git a/ImperatorToCK3/CK3/Cultures/NameList.cs b/ImperatorToCK3/CK3/Cultures/NameList.cs index 8a753c61f..079d48a44 100644 --- a/ImperatorToCK3/CK3/Cultures/NameList.cs +++ b/ImperatorToCK3/CK3/Cultures/NameList.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.Text.RegularExpressions; -namespace ImperatorToCK3.CK3.Cultures; +namespace ImperatorToCK3.CK3.Cultures; -public sealed partial class NameList : IIdentifiable { +internal sealed partial class NameList : IIdentifiable { public string Id { get; } private readonly OrderedSet maleNames = []; private readonly OrderedSet femaleNames = []; diff --git a/ImperatorToCK3/CK3/Dynasties/House.cs b/ImperatorToCK3/CK3/Dynasties/House.cs index de8d5c5dd..e4634ee1d 100644 --- a/ImperatorToCK3/CK3/Dynasties/House.cs +++ b/ImperatorToCK3/CK3/Dynasties/House.cs @@ -6,7 +6,7 @@ namespace ImperatorToCK3.CK3.Dynasties; [SerializationByProperties] -public sealed partial class House : IPDXSerializable, IIdentifiable { +internal sealed partial class House : IPDXSerializable, IIdentifiable { [NonSerialized] public string Id { get; } [SerializedName("prefix")] public string? Prefix { get; private set; } diff --git a/ImperatorToCK3/CK3/Legends/LegendSeed.cs b/ImperatorToCK3/CK3/Legends/LegendSeed.cs index 5fb08be40..e786d5536 100644 --- a/ImperatorToCK3/CK3/Legends/LegendSeed.cs +++ b/ImperatorToCK3/CK3/Legends/LegendSeed.cs @@ -4,7 +4,7 @@ namespace ImperatorToCK3.CK3.Legends; -public sealed class LegendSeed : IIdentifiable, IPDXSerializable { +internal sealed class LegendSeed : IIdentifiable, IPDXSerializable { public string Id { get; } private StringOfItem Body { get; } diff --git a/ImperatorToCK3/CK3/Legends/LegendSeedCollection.cs b/ImperatorToCK3/CK3/Legends/LegendSeedCollection.cs index d0df7b459..b01a04156 100644 --- a/ImperatorToCK3/CK3/Legends/LegendSeedCollection.cs +++ b/ImperatorToCK3/CK3/Legends/LegendSeedCollection.cs @@ -6,7 +6,7 @@ namespace ImperatorToCK3.CK3.Legends; -public sealed class LegendSeedCollection : ConcurrentIdObjectCollection, IPDXSerializable { +internal sealed class LegendSeedCollection : ConcurrentIdObjectCollection, IPDXSerializable { public void LoadSeeds(ModFilesystem ck3ModFS) { Logger.Info("Loading legend seeds..."); diff --git a/ImperatorToCK3/CK3/Provinces/ProvinceMappings.cs b/ImperatorToCK3/CK3/Provinces/ProvinceMappings.cs index 433256fbe..814f467f1 100644 --- a/ImperatorToCK3/CK3/Provinces/ProvinceMappings.cs +++ b/ImperatorToCK3/CK3/Provinces/ProvinceMappings.cs @@ -22,7 +22,7 @@ namespace ImperatorToCK3.CK3.Provinces; /// /// Now 6874 history is same as 6872 history. /// -public sealed class ProvinceMappings : Dictionary { +internal sealed class ProvinceMappings : Dictionary { public ProvinceMappings(ModFilesystem ck3ModFS) { var parser = new Parser(); RegisterKeys(parser); diff --git a/ImperatorToCK3/CK3/Religions/DoctrineCategory.cs b/ImperatorToCK3/CK3/Religions/DoctrineCategory.cs index 8b74aa446..8f7b14f1b 100644 --- a/ImperatorToCK3/CK3/Religions/DoctrineCategory.cs +++ b/ImperatorToCK3/CK3/Religions/DoctrineCategory.cs @@ -3,14 +3,14 @@ using System.Collections.Generic; using System.Collections.Immutable; -namespace ImperatorToCK3.CK3.Religions; +namespace ImperatorToCK3.CK3.Religions; -public sealed class DoctrineCategory : IIdentifiable { +internal sealed class DoctrineCategory : IIdentifiable { public string Id { get; } public string? GroupId { get; private set; } public int NumberOfPicks { get; private set; } = 1; - private readonly OrderedSet doctrineIds = new(); + private readonly OrderedSet doctrineIds = []; public IReadOnlyCollection DoctrineIds => doctrineIds.ToImmutableArray(); public DoctrineCategory(string id, BufferedReader categoryReader) { diff --git a/ImperatorToCK3/CK3/Titles/LandedTitles.cs b/ImperatorToCK3/CK3/Titles/LandedTitles.cs index e790de4ff..81149226b 100644 --- a/ImperatorToCK3/CK3/Titles/LandedTitles.cs +++ b/ImperatorToCK3/CK3/Titles/LandedTitles.cs @@ -38,7 +38,7 @@ internal sealed partial class Title { // This is a recursive class that scrapes common/landed_titles looking for title colors, landlessness, // and most importantly relation between baronies and barony provinces so we can link titles to actual clay. // Since titles are nested according to hierarchy we do this recursively. - public sealed class LandedTitles : TitleCollection { + internal sealed class LandedTitles : TitleCollection { public Dictionary Variables { get; } = []; public IEnumerable Counties => this.Where(t => t.Rank == TitleRank.county); diff --git a/ImperatorToCK3/CommonUtils/ConcurrentIgnoredKeywordsSet.cs b/ImperatorToCK3/CommonUtils/ConcurrentIgnoredKeywordsSet.cs index 0a95cc6fe..eb17c23c1 100644 --- a/ImperatorToCK3/CommonUtils/ConcurrentIgnoredKeywordsSet.cs +++ b/ImperatorToCK3/CommonUtils/ConcurrentIgnoredKeywordsSet.cs @@ -3,7 +3,7 @@ namespace ImperatorToCK3.CommonUtils; -public sealed class ConcurrentIgnoredKeywordsSet : ConcurrentSet<string> { +internal sealed class ConcurrentIgnoredKeywordsSet : ConcurrentSet<string> { public override string ToString() { return string.Join(", ", this.Order()); } diff --git a/ImperatorToCK3/CommonUtils/FieldValue.cs b/ImperatorToCK3/CommonUtils/FieldValue.cs index cf123839a..0c3178809 100644 --- a/ImperatorToCK3/CommonUtils/FieldValue.cs +++ b/ImperatorToCK3/CommonUtils/FieldValue.cs @@ -2,7 +2,7 @@ namespace ImperatorToCK3.CommonUtils; -public sealed class FieldValue { +internal sealed class FieldValue { public object? Value { get; set; } public string Setter { get; set; } // setter that was used to set the value public FieldValue(object? value, string setter) { diff --git a/ImperatorToCK3/CommonUtils/Genes/MorphGene.cs b/ImperatorToCK3/CommonUtils/Genes/MorphGene.cs index e68650fbe..036cba23f 100644 --- a/ImperatorToCK3/CommonUtils/Genes/MorphGene.cs +++ b/ImperatorToCK3/CommonUtils/Genes/MorphGene.cs @@ -4,7 +4,7 @@ namespace ImperatorToCK3.CommonUtils.Genes; -public sealed class MorphGene : Gene, IIdentifiable<string> { +internal sealed class MorphGene : Gene, IIdentifiable<string> { public string Id { get; } public uint? Index { get; private set; } public IdObjectCollection<string, MorphGeneTemplate> GeneTemplates { get; } = []; diff --git a/ImperatorToCK3/CommonUtils/Genes/MorphGeneTemplate.cs b/ImperatorToCK3/CommonUtils/Genes/MorphGeneTemplate.cs index 5ca1492bb..a53b9c41d 100644 --- a/ImperatorToCK3/CommonUtils/Genes/MorphGeneTemplate.cs +++ b/ImperatorToCK3/CommonUtils/Genes/MorphGeneTemplate.cs @@ -3,7 +3,7 @@ namespace ImperatorToCK3.CommonUtils.Genes; -public sealed class MorphGeneTemplate : IIdentifiable<string> { +internal sealed class MorphGeneTemplate : IIdentifiable<string> { public string Id { get; } public uint Index { get; private set; } = 0; public bool Visible { get; private set; } = true; diff --git a/ImperatorToCK3/CommonUtils/Genes/WeightBlock.cs b/ImperatorToCK3/CommonUtils/Genes/WeightBlock.cs index 15e8dd6a1..b90984348 100644 --- a/ImperatorToCK3/CommonUtils/Genes/WeightBlock.cs +++ b/ImperatorToCK3/CommonUtils/Genes/WeightBlock.cs @@ -5,7 +5,7 @@ namespace ImperatorToCK3.CommonUtils.Genes; -public sealed class WeightBlock { +internal sealed class WeightBlock { public uint SumOfAbsoluteWeights { get; private set; } = 0; private readonly List<KeyValuePair<string, uint>> objectsList = []; diff --git a/ImperatorToCK3/CommonUtils/HistoryFactory.cs b/ImperatorToCK3/CommonUtils/HistoryFactory.cs index 822e1f8ec..fd168fa8b 100644 --- a/ImperatorToCK3/CommonUtils/HistoryFactory.cs +++ b/ImperatorToCK3/CommonUtils/HistoryFactory.cs @@ -6,7 +6,7 @@ namespace ImperatorToCK3.CommonUtils; internal sealed class HistoryFactory { - public sealed class HistoryFactoryBuilder { + internal sealed class HistoryFactoryBuilder { private readonly List<SimpleFieldDef> simpleFieldDefs = []; // fieldName, setters, initialValue private readonly List<SimpleFieldDef> literalFieldDefs = []; // fieldName, setters, initialValue private readonly List<DiffFieldDef> diffFieldDefs = []; // fieldName, inserter, remover, initialValue diff --git a/ImperatorToCK3/CommonUtils/IgnoredKeywordsSet.cs b/ImperatorToCK3/CommonUtils/IgnoredKeywordsSet.cs index 8c8e89c4a..faa6b0ba9 100644 --- a/ImperatorToCK3/CommonUtils/IgnoredKeywordsSet.cs +++ b/ImperatorToCK3/CommonUtils/IgnoredKeywordsSet.cs @@ -3,7 +3,7 @@ namespace ImperatorToCK3.CommonUtils; -public sealed class IgnoredKeywordsSet : HashSet<string> { +internal sealed class IgnoredKeywordsSet : HashSet<string> { public override string ToString() { return string.Join(", ", this.Order()); } diff --git a/ImperatorToCK3/CommonUtils/Map/ProvinceDefinition.cs b/ImperatorToCK3/CommonUtils/Map/ProvinceDefinition.cs index 8b764121f..a9c149828 100644 --- a/ImperatorToCK3/CommonUtils/Map/ProvinceDefinition.cs +++ b/ImperatorToCK3/CommonUtils/Map/ProvinceDefinition.cs @@ -3,7 +3,7 @@ namespace ImperatorToCK3.CommonUtils.Map; -public sealed class ProvinceDefinition(ulong id) : IIdentifiable<ulong> { +internal sealed class ProvinceDefinition(ulong id) : IIdentifiable<ulong> { public ulong Id { get; } = id; private readonly HashSet<SpecialProvinceCategory> specialCategories = []; diff --git a/ImperatorToCK3/CommonUtils/Map/ProvincePosition.cs b/ImperatorToCK3/CommonUtils/Map/ProvincePosition.cs index f7b645185..1f18e5c12 100644 --- a/ImperatorToCK3/CommonUtils/Map/ProvincePosition.cs +++ b/ImperatorToCK3/CommonUtils/Map/ProvincePosition.cs @@ -2,7 +2,7 @@ namespace ImperatorToCK3.CommonUtils.Map; -public sealed class ProvincePosition { +internal sealed class ProvincePosition { public ulong Id { get; private set; } public double X { get; private set; } public double Y { get; private set; } diff --git a/ImperatorToCK3/CommonUtils/SimpleFieldDef.cs b/ImperatorToCK3/CommonUtils/SimpleFieldDef.cs index 958df3621..d6eac6fcb 100644 --- a/ImperatorToCK3/CommonUtils/SimpleFieldDef.cs +++ b/ImperatorToCK3/CommonUtils/SimpleFieldDef.cs @@ -2,8 +2,8 @@ namespace ImperatorToCK3.CommonUtils; -public sealed class SimpleFieldDef { +internal sealed class SimpleFieldDef { public string FieldName { get; init; } = ""; - public OrderedSet<string> Setters { get; init; } = new(); + public OrderedSet<string> Setters { get; init; } = []; public object? InitialValue { get; init; } } \ No newline at end of file diff --git a/ImperatorToCK3/Configuration.cs b/ImperatorToCK3/Configuration.cs index 39308bf57..0d5599a8f 100644 --- a/ImperatorToCK3/Configuration.cs +++ b/ImperatorToCK3/Configuration.cs @@ -10,8 +10,8 @@ namespace ImperatorToCK3; -public enum LegionConversion { No, SpecialTroops, MenAtArms } -public sealed class Configuration { +internal enum LegionConversion { No, SpecialTroops, MenAtArms } +internal sealed class Configuration { public string SaveGamePath { get; set; } = ""; public string ImperatorPath { get; set; } = ""; public string ImperatorDocPath { get; set; } = ""; diff --git a/ImperatorToCK3/Imperator/Armies/Subunit.cs b/ImperatorToCK3/Imperator/Armies/Subunit.cs index 91792038b..df03cacbd 100644 --- a/ImperatorToCK3/Imperator/Armies/Subunit.cs +++ b/ImperatorToCK3/Imperator/Armies/Subunit.cs @@ -3,7 +3,7 @@ using ImperatorToCK3.CommonUtils; namespace ImperatorToCK3.Imperator.Armies; -public sealed class Subunit : IIdentifiable<ulong> { +internal sealed class Subunit : IIdentifiable<ulong> { public ulong Id { get; } public string Category { get; private set; } = "levy"; public string Type { get; private set; } = "light_infantry"; diff --git a/ImperatorToCK3/Imperator/Characters/CharacterAttributes.cs b/ImperatorToCK3/Imperator/Characters/CharacterAttributes.cs index 98340023a..05ac88e7a 100644 --- a/ImperatorToCK3/Imperator/Characters/CharacterAttributes.cs +++ b/ImperatorToCK3/Imperator/Characters/CharacterAttributes.cs @@ -2,7 +2,7 @@ namespace ImperatorToCK3.Imperator.Characters; -public sealed class CharacterAttributes { +internal sealed class CharacterAttributes { public int Martial { get; set; } = 0; public int Finesse { get; set; } = 0; public int Charisma { get; set; } = 0; diff --git a/ImperatorToCK3/Imperator/Characters/CharacterName.cs b/ImperatorToCK3/Imperator/Characters/CharacterName.cs index f3766d5d5..61d6a1ecc 100644 --- a/ImperatorToCK3/Imperator/Characters/CharacterName.cs +++ b/ImperatorToCK3/Imperator/Characters/CharacterName.cs @@ -2,7 +2,7 @@ namespace ImperatorToCK3.Imperator.Characters; -public sealed class CharacterName { +internal sealed class CharacterName { public string Name { get; private set; } = string.Empty; // key for localization or literal name public string? CustomName { get; private set; } // localized diff --git a/ImperatorToCK3/Imperator/Characters/PaletteCoordinates.cs b/ImperatorToCK3/Imperator/Characters/PaletteCoordinates.cs index cb6467d60..30ffe8d1e 100644 --- a/ImperatorToCK3/Imperator/Characters/PaletteCoordinates.cs +++ b/ImperatorToCK3/Imperator/Characters/PaletteCoordinates.cs @@ -1,6 +1,6 @@ namespace ImperatorToCK3.Imperator.Characters; -public sealed class PaletteCoordinates { +internal sealed class PaletteCoordinates { // palettes are 512x512 public int X { get; set; } = 256; public int Y { get; set; } = 256; diff --git a/ImperatorToCK3/Imperator/Characters/Unborn.cs b/ImperatorToCK3/Imperator/Characters/Unborn.cs index 32ab87959..aa7eda3e6 100644 --- a/ImperatorToCK3/Imperator/Characters/Unborn.cs +++ b/ImperatorToCK3/Imperator/Characters/Unborn.cs @@ -2,7 +2,7 @@ namespace ImperatorToCK3.Imperator.Characters; -public sealed class Unborn { +internal sealed class Unborn { public ulong MotherId { get; } public ulong FatherId { get; } public Date BirthDate { get; } diff --git a/ImperatorToCK3/Imperator/Countries/CountryCurrencies.cs b/ImperatorToCK3/Imperator/Countries/CountryCurrencies.cs index 9a91e80cd..a8e409370 100644 --- a/ImperatorToCK3/Imperator/Countries/CountryCurrencies.cs +++ b/ImperatorToCK3/Imperator/Countries/CountryCurrencies.cs @@ -3,7 +3,7 @@ namespace ImperatorToCK3.Imperator.Countries; -public sealed class CountryCurrencies : Parser { +internal sealed class CountryCurrencies : Parser { public double Manpower { get; private set; } = 0; public double Gold { get; private set; } = 0; public double Stability { get; private set; } = 50; diff --git a/ImperatorToCK3/Imperator/Countries/RulerTerm.cs b/ImperatorToCK3/Imperator/Countries/RulerTerm.cs index 02732ea75..34f4e0d3f 100644 --- a/ImperatorToCK3/Imperator/Countries/RulerTerm.cs +++ b/ImperatorToCK3/Imperator/Countries/RulerTerm.cs @@ -6,7 +6,7 @@ namespace ImperatorToCK3.Imperator.Countries; internal sealed class RulerTerm { - public sealed class PreImperatorRulerInfo { + internal sealed class PreImperatorRulerInfo { public string? Name { get; set; } public Date? BirthDate { get; set; } public Date? DeathDate { get; set; } diff --git a/ImperatorToCK3/Imperator/Cultures/Culture.cs b/ImperatorToCK3/Imperator/Cultures/Culture.cs index 7c8450879..7306a490b 100644 --- a/ImperatorToCK3/Imperator/Cultures/Culture.cs +++ b/ImperatorToCK3/Imperator/Cultures/Culture.cs @@ -4,7 +4,7 @@ namespace ImperatorToCK3.Imperator.Cultures; -public sealed class Culture : IIdentifiable<string> { +internal sealed class Culture : IIdentifiable<string> { public string Id { get; } private readonly Dictionary<string, string> familyNamesDict = new(); // <key, male form> diff --git a/ImperatorToCK3/Imperator/Cultures/CultureGroup.cs b/ImperatorToCK3/Imperator/Cultures/CultureGroup.cs index fcc126303..4460e3b40 100644 --- a/ImperatorToCK3/Imperator/Cultures/CultureGroup.cs +++ b/ImperatorToCK3/Imperator/Cultures/CultureGroup.cs @@ -4,7 +4,7 @@ namespace ImperatorToCK3.Imperator.Cultures; -public sealed class CultureGroup : IdObjectCollection<string, Culture>, IIdentifiable<string> { +internal sealed class CultureGroup : IdObjectCollection<string, Culture>, IIdentifiable<string> { public string Id { get; } private readonly Dictionary<string, string> familyNamesDict = new(); // <key, male form> diff --git a/ImperatorToCK3/Imperator/Cultures/CulturesDB.cs b/ImperatorToCK3/Imperator/Cultures/CulturesDB.cs index 8e62f758f..4f16d413d 100644 --- a/ImperatorToCK3/Imperator/Cultures/CulturesDB.cs +++ b/ImperatorToCK3/Imperator/Cultures/CulturesDB.cs @@ -4,7 +4,7 @@ namespace ImperatorToCK3.Imperator.Cultures; -public sealed class CulturesDB : IdObjectCollection<string, CultureGroup> { +internal sealed class CulturesDB : IdObjectCollection<string, CultureGroup> { public void Load(ModFilesystem irModFS) { Logger.Info("Loading cultures database..."); diff --git a/ImperatorToCK3/Imperator/Defines.cs b/ImperatorToCK3/Imperator/Defines.cs index 05507b4f2..8dc20a296 100644 --- a/ImperatorToCK3/Imperator/Defines.cs +++ b/ImperatorToCK3/Imperator/Defines.cs @@ -2,7 +2,7 @@ using commonItems.Mods; namespace ImperatorToCK3.Imperator; -public sealed class ImperatorDefines : Defines { +internal sealed class ImperatorDefines : Defines { public int CohortSize { get; private set; } = 500; public new void LoadDefines(ModFilesystem modFS) { diff --git a/ImperatorToCK3/Imperator/Diplomacy/Dependency.cs b/ImperatorToCK3/Imperator/Diplomacy/Dependency.cs index f5bcaf15f..26190a9b0 100644 --- a/ImperatorToCK3/Imperator/Diplomacy/Dependency.cs +++ b/ImperatorToCK3/Imperator/Diplomacy/Dependency.cs @@ -2,7 +2,7 @@ namespace ImperatorToCK3.Imperator.Diplomacy; -public sealed class Dependency(ulong overlordId, ulong subjectId, Date startDate, string subjectType) { +internal sealed class Dependency(ulong overlordId, ulong subjectId, Date startDate, string subjectType) { public ulong OverlordId { get; } = overlordId; public ulong SubjectId { get; } = subjectId; public Date StartDate { get; } = startDate; diff --git a/ImperatorToCK3/Imperator/Inventions/InventionsDB.cs b/ImperatorToCK3/Imperator/Inventions/InventionsDB.cs index 757ad2916..fef6af7d4 100644 --- a/ImperatorToCK3/Imperator/Inventions/InventionsDB.cs +++ b/ImperatorToCK3/Imperator/Inventions/InventionsDB.cs @@ -6,7 +6,7 @@ namespace ImperatorToCK3.Imperator.Inventions; -public sealed class InventionsDB { +internal sealed class InventionsDB { private readonly OrderedSet<string> inventionIds = []; public IReadOnlyCollection<string> InventionIds => inventionIds; diff --git a/ImperatorToCK3/Imperator/Pops/Pop.cs b/ImperatorToCK3/Imperator/Pops/Pop.cs index f0729fb8b..15305dea9 100644 --- a/ImperatorToCK3/Imperator/Pops/Pop.cs +++ b/ImperatorToCK3/Imperator/Pops/Pop.cs @@ -3,7 +3,7 @@ namespace ImperatorToCK3.Imperator.Pops; -public sealed class Pop : IIdentifiable<ulong> { +internal sealed class Pop : IIdentifiable<ulong> { public ulong Id { get; } = 0; public string Type { get; set; } = ""; public string Culture { get; set; } = ""; diff --git a/ImperatorToCK3/Imperator/Pops/PopCollection.cs b/ImperatorToCK3/Imperator/Pops/PopCollection.cs index 9d74475df..9599d2489 100644 --- a/ImperatorToCK3/Imperator/Pops/PopCollection.cs +++ b/ImperatorToCK3/Imperator/Pops/PopCollection.cs @@ -6,7 +6,7 @@ namespace ImperatorToCK3.Imperator.Pops; -public sealed class PopCollection : ConcurrentIdObjectCollection<ulong, Pop> { +internal sealed class PopCollection : ConcurrentIdObjectCollection<ulong, Pop> { public void LoadPopsFromBloc(BufferedReader blocReader) { var blocParser = new Parser(); blocParser.RegisterKeyword("population", LoadPops); diff --git a/ImperatorToCK3/Imperator/Provinces/ProvinceName.cs b/ImperatorToCK3/Imperator/Provinces/ProvinceName.cs index d69094cba..7f14af9f8 100644 --- a/ImperatorToCK3/Imperator/Provinces/ProvinceName.cs +++ b/ImperatorToCK3/Imperator/Provinces/ProvinceName.cs @@ -2,7 +2,7 @@ namespace ImperatorToCK3.Imperator.Provinces; -public sealed class ProvinceName { +internal sealed class ProvinceName { public string Name { get; private set; } = ""; public ProvinceName(BufferedReader reader) { diff --git a/ImperatorToCK3/Imperator/Religions/Deity.cs b/ImperatorToCK3/Imperator/Religions/Deity.cs index a3c828875..2cbfc9aac 100644 --- a/ImperatorToCK3/Imperator/Religions/Deity.cs +++ b/ImperatorToCK3/Imperator/Religions/Deity.cs @@ -5,7 +5,7 @@ namespace ImperatorToCK3.Imperator.Religions; -public sealed class Deity : IIdentifiable<string> { +internal sealed class Deity : IIdentifiable<string> { public string Id { get; } public OrderedDictionary<string, double> PassiveModifiers { get; } = []; diff --git a/ImperatorToCK3/Imperator/Religions/Religion.cs b/ImperatorToCK3/Imperator/Religions/Religion.cs index fdf4bc133..044383b79 100644 --- a/ImperatorToCK3/Imperator/Religions/Religion.cs +++ b/ImperatorToCK3/Imperator/Religions/Religion.cs @@ -3,7 +3,7 @@ namespace ImperatorToCK3.Imperator.Religions; -public sealed class Religion : IIdentifiable<string> { +internal sealed class Religion : IIdentifiable<string> { public string Id { get; } public OrderedDictionary<string, double> Modifiers { get; } diff --git a/ImperatorToCK3/Imperator/Religions/ReligionCollection.cs b/ImperatorToCK3/Imperator/Religions/ReligionCollection.cs index d44785dd0..bd665ba90 100644 --- a/ImperatorToCK3/Imperator/Religions/ReligionCollection.cs +++ b/ImperatorToCK3/Imperator/Religions/ReligionCollection.cs @@ -7,7 +7,7 @@ namespace ImperatorToCK3.Imperator.Religions; -public sealed class ReligionCollection : IdObjectCollection<string, Religion> { +internal sealed class ReligionCollection : IdObjectCollection<string, Religion> { public IdObjectCollection<string, Deity> Deities { get; } = []; private readonly Dictionary<ulong, string> holySiteIdToDeityIdDict = []; diff --git a/ImperatorToCK3/Mappers/DeathReason/DeathReasonMapper.cs b/ImperatorToCK3/Mappers/DeathReason/DeathReasonMapper.cs index fe23c94f6..632fe82fe 100644 --- a/ImperatorToCK3/Mappers/DeathReason/DeathReasonMapper.cs +++ b/ImperatorToCK3/Mappers/DeathReason/DeathReasonMapper.cs @@ -3,7 +3,7 @@ namespace ImperatorToCK3.Mappers.DeathReason; -public sealed class DeathReasonMapper { +internal sealed class DeathReasonMapper { public DeathReasonMapper() { Logger.Info("Parsing death reason mappings..."); var parser = new Parser(); diff --git a/ImperatorToCK3/Mappers/Gene/AccessoryGeneMapper.cs b/ImperatorToCK3/Mappers/Gene/AccessoryGeneMapper.cs index 758f82d95..ad6947766 100644 --- a/ImperatorToCK3/Mappers/Gene/AccessoryGeneMapper.cs +++ b/ImperatorToCK3/Mappers/Gene/AccessoryGeneMapper.cs @@ -5,7 +5,7 @@ namespace ImperatorToCK3.Mappers.Gene; -public sealed class AccessoryGeneMapper { +internal sealed class AccessoryGeneMapper { private Dictionary<string, List<Assignment>> ObjectToObjectMappings { get; } = []; private Dictionary<string, List<Assignment>> TemplateToTemplateMappings { get; } = []; diff --git a/ImperatorToCK3/Mappers/Gene/MorphGeneTemplateMapper.cs b/ImperatorToCK3/Mappers/Gene/MorphGeneTemplateMapper.cs index bc03d531d..e8f4f23f8 100644 --- a/ImperatorToCK3/Mappers/Gene/MorphGeneTemplateMapper.cs +++ b/ImperatorToCK3/Mappers/Gene/MorphGeneTemplateMapper.cs @@ -5,7 +5,7 @@ namespace ImperatorToCK3.Mappers.Gene; -public sealed class MorphGeneTemplateMapper { +internal sealed class MorphGeneTemplateMapper { private readonly Dictionary<string, IList<Assignment>> templateMappings = []; // <geneName, <irTemplate, ck3Template>> public MorphGeneTemplateMapper(string mappingsFilePath) { diff --git a/ImperatorToCK3/Mappers/HolySiteEffect/HolySiteEffectMapper.cs b/ImperatorToCK3/Mappers/HolySiteEffect/HolySiteEffectMapper.cs index 640644931..cee45df35 100644 --- a/ImperatorToCK3/Mappers/HolySiteEffect/HolySiteEffectMapper.cs +++ b/ImperatorToCK3/Mappers/HolySiteEffect/HolySiteEffectMapper.cs @@ -3,7 +3,7 @@ namespace ImperatorToCK3.Mappers.HolySiteEffect; -public sealed class HolySiteEffectMapper { +internal sealed class HolySiteEffectMapper { private readonly Dictionary<string, KeyValuePair<string, double>> effectMap = new(); // imperator effect, <ck3 effect, factor> public HolySiteEffectMapper(string mappingsFilePath) { diff --git a/ImperatorToCK3/Mappers/Nickname/NicknameMapper.cs b/ImperatorToCK3/Mappers/Nickname/NicknameMapper.cs index 45b5748b6..ef386bdb4 100644 --- a/ImperatorToCK3/Mappers/Nickname/NicknameMapper.cs +++ b/ImperatorToCK3/Mappers/Nickname/NicknameMapper.cs @@ -3,7 +3,7 @@ namespace ImperatorToCK3.Mappers.Nickname; -public sealed class NicknameMapper { +internal sealed class NicknameMapper { private readonly Dictionary<string, string> impToCK3NicknameMap = new(); public NicknameMapper() { } diff --git a/ImperatorToCK3/Mappers/SuccessionLaw/SuccessionLawMapper.cs b/ImperatorToCK3/Mappers/SuccessionLaw/SuccessionLawMapper.cs index 00d24d15a..0cbbec4e3 100644 --- a/ImperatorToCK3/Mappers/SuccessionLaw/SuccessionLawMapper.cs +++ b/ImperatorToCK3/Mappers/SuccessionLaw/SuccessionLawMapper.cs @@ -5,7 +5,7 @@ namespace ImperatorToCK3.Mappers.SuccessionLaw; -public sealed class SuccessionLawMapper { +internal sealed class SuccessionLawMapper { private readonly List<SuccessionLawMapping> mappings = []; public SuccessionLawMapper() { } diff --git a/ImperatorToCK3/Mappers/TagTitle/DefiniteFormMapper.cs b/ImperatorToCK3/Mappers/TagTitle/DefiniteFormMapper.cs index 6ecfbe068..ef4df30ca 100644 --- a/ImperatorToCK3/Mappers/TagTitle/DefiniteFormMapper.cs +++ b/ImperatorToCK3/Mappers/TagTitle/DefiniteFormMapper.cs @@ -3,7 +3,7 @@ namespace ImperatorToCK3.Mappers.TagTitle; -public sealed class DefiniteFormMapper { +internal sealed class DefiniteFormMapper { public DefiniteFormMapper() { } public DefiniteFormMapper(string configurablePath) { var parser = new Parser(); diff --git a/ImperatorToCK3/Mappers/Technology/InnovationBonus.cs b/ImperatorToCK3/Mappers/Technology/InnovationBonus.cs index 4d0ca7b11..37cacea88 100644 --- a/ImperatorToCK3/Mappers/Technology/InnovationBonus.cs +++ b/ImperatorToCK3/Mappers/Technology/InnovationBonus.cs @@ -4,7 +4,7 @@ namespace ImperatorToCK3.Mappers.Technology; -public sealed class InnovationBonus { +internal sealed class InnovationBonus { private readonly HashSet<string> imperatorInventions = []; public string? CK3InnovationId { get; private set; } diff --git a/ImperatorToCK3/Mappers/Technology/InnovationLink.cs b/ImperatorToCK3/Mappers/Technology/InnovationLink.cs index 7d7287d19..4c7c88944 100644 --- a/ImperatorToCK3/Mappers/Technology/InnovationLink.cs +++ b/ImperatorToCK3/Mappers/Technology/InnovationLink.cs @@ -2,7 +2,7 @@ namespace ImperatorToCK3.Mappers.Technology; -public sealed class InnovationLink { +internal sealed class InnovationLink { private string? imperatorInvention; public string? CK3InnovationId { get; private set; } diff --git a/ImperatorToCK3/Mappers/War/WarMapper.cs b/ImperatorToCK3/Mappers/War/WarMapper.cs index 615f50381..cbbcc77fd 100644 --- a/ImperatorToCK3/Mappers/War/WarMapper.cs +++ b/ImperatorToCK3/Mappers/War/WarMapper.cs @@ -4,7 +4,7 @@ namespace ImperatorToCK3.Mappers.War; -public sealed class WarMapper { +internal sealed class WarMapper { private readonly Dictionary<string, string> impToCK3WarGoalDict = []; public WarMapper(string filePath) { diff --git a/ImperatorToCK3/Outputter/FileTweaker.cs b/ImperatorToCK3/Outputter/FileTweaker.cs index b7a3224d6..6243eeb1c 100644 --- a/ImperatorToCK3/Outputter/FileTweaker.cs +++ b/ImperatorToCK3/Outputter/FileTweaker.cs @@ -15,7 +15,7 @@ internal enum LineEnding { CR } -public static class FileTweaker { +internal static class FileTweaker { public static async Task ModifyAndRemovePartsOfFiles(ModFilesystem ck3ModFS, string outputModPath, Configuration config) { // Load removable blocks from configurables. Dictionary<string, OrderedSet<PartOfFileToModify>> partsToModifyPerFile = []; diff --git a/ImperatorToCK3/Outputter/OnActionOutputter.cs b/ImperatorToCK3/Outputter/OnActionOutputter.cs index 3cabfd331..d50fb1967 100644 --- a/ImperatorToCK3/Outputter/OnActionOutputter.cs +++ b/ImperatorToCK3/Outputter/OnActionOutputter.cs @@ -4,9 +4,9 @@ using System.Text; using System.Threading.Tasks; -namespace ImperatorToCK3.Outputter; +namespace ImperatorToCK3.Outputter; -public static class OnActionOutputter { +internal static class OnActionOutputter { public static async Task OutputEverything(Configuration config, ModFilesystem ck3ModFS, string outputModPath){ await OutputCustomGameStartOnAction(config); Logger.IncrementProgress(); From 7162b2fa60b276f0cbd4dbbdb43c1c277e648241 Mon Sep 17 00:00:00 2001 From: iht <IhateTrains@users.noreply.github.com> Date: Sat, 13 Sep 2025 00:30:40 +0200 Subject: [PATCH 2/2] Make 3 more classes internal --- ImperatorToCK3/CK3/Localization/CK3LocBlock.cs | 2 +- ImperatorToCK3/CommonUtils/Genes/Gene.cs | 2 +- ImperatorToCK3/Exceptions/ConverterException.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ImperatorToCK3/CK3/Localization/CK3LocBlock.cs b/ImperatorToCK3/CK3/Localization/CK3LocBlock.cs index 6278922b0..f4d303d1e 100644 --- a/ImperatorToCK3/CK3/Localization/CK3LocBlock.cs +++ b/ImperatorToCK3/CK3/Localization/CK3LocBlock.cs @@ -5,7 +5,7 @@ namespace ImperatorToCK3.CK3.Localization; -public class CK3LocBlock : IIdentifiable<string> { // TODO: add ILocBlock interface that both this and commonItems' LocBlock would implement. +internal class CK3LocBlock : IIdentifiable<string> { // TODO: add ILocBlock interface that both this and commonItems' LocBlock would implement. private readonly string baseLanguage; private readonly ConcurrentDictionary<string, (string, CK3LocType)> localizations = new(); diff --git a/ImperatorToCK3/CommonUtils/Genes/Gene.cs b/ImperatorToCK3/CommonUtils/Genes/Gene.cs index 9dd654433..9fe5bf057 100644 --- a/ImperatorToCK3/CommonUtils/Genes/Gene.cs +++ b/ImperatorToCK3/CommonUtils/Genes/Gene.cs @@ -1,5 +1,5 @@ namespace ImperatorToCK3.CommonUtils.Genes; -public class Gene { +internal class Gene { public bool Inheritable { get; internal set; } = true; } \ No newline at end of file diff --git a/ImperatorToCK3/Exceptions/ConverterException.cs b/ImperatorToCK3/Exceptions/ConverterException.cs index bd588546b..c7a0fa140 100644 --- a/ImperatorToCK3/Exceptions/ConverterException.cs +++ b/ImperatorToCK3/Exceptions/ConverterException.cs @@ -2,7 +2,7 @@ namespace ImperatorToCK3.Exceptions; -public class ConverterException : Exception { +internal class ConverterException : Exception { public ConverterException(string message) : base(message) { } public ConverterException(string? message, Exception? innerException) : base(message, innerException) { }