Skip to content

Commit

Permalink
Make CoaMapper internal, reduce interface use (#2362)
Browse files Browse the repository at this point in the history
  • Loading branch information
IhateTrains authored Dec 15, 2024
1 parent 75c0ff7 commit 69dfd99
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions ImperatorToCK3/CK3/Titles/LandedTitles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public Title Add(string id) {
return newTitle;
}

public Title Add(
internal Title Add(
Country country,
Dependency? dependency,
CountryCollection imperatorCountries,
Expand Down Expand Up @@ -191,7 +191,7 @@ IReadOnlyCollection<string> enabledCK3Dlcs
return newTitle;
}

public Title Add(
internal Title Add(
string id,
Governorship governorship,
Country country,
Expand Down Expand Up @@ -340,7 +340,7 @@ public void CleanUpHistory(CharacterCollection characters, Date ck3BookmarkDate)
}
}

public void ImportImperatorCountries(
internal void ImportImperatorCountries(
CountryCollection imperatorCountries,
IReadOnlyCollection<Dependency> dependencies,
TagTitleMapper tagTitleMapper,
Expand Down Expand Up @@ -497,7 +497,7 @@ private void ImportImperatorCountry(
}
}

public void ImportImperatorGovernorships(
internal void ImportImperatorGovernorships(
Imperator.World irWorld,
ProvinceCollection ck3Provinces,
TagTitleMapper tagTitleMapper,
Expand Down Expand Up @@ -1617,7 +1617,7 @@ public void LoadCulturalNamesFromConfigurables() {
parser.ParseFile(filePath);
}

public void SetCoatsOfArms(CoaMapper coaMapper) {
internal void SetCoatsOfArms(CoaMapper coaMapper) {
Logger.Info("Setting coats of arms for CK3 titles...");

int counter = 0;
Expand Down
2 changes: 1 addition & 1 deletion ImperatorToCK3/CK3/Titles/Title.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ private Title(Title? baseTitle, Title overrideTitle, LandedTitles parentCollecti
vassal.DeJureLiege = this;
}
}
public void InitializeFromTag(
internal void InitializeFromTag(
Country country,
Dependency? dependency,
CountryCollection imperatorCountries,
Expand Down
2 changes: 1 addition & 1 deletion ImperatorToCK3/CK3/World.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public sealed class World {
public MapData MapData { get; private set; } = null!;
public IList<Wars.War> Wars { get; } = new List<Wars.War>();
public LegendSeedCollection LegendSeeds { get; } = [];
public CoaMapper CK3CoaMapper { get; private set; } = null!;
internal CoaMapper CK3CoaMapper { get; private set; } = null!;
private readonly List<string> enabledDlcFlags = [];

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion ImperatorToCK3/Imperator/World.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public partial class World {
private readonly PopCollection pops = [];
public ProvinceCollection Provinces { get; } = [];
public CountryCollection Countries { get; } = [];
public CoaMapper CoaMapper { get; private set; } = new();
internal CoaMapper CoaMapper { get; private set; } = new();
public MapData MapData { get; private set; }
public AreaCollection Areas { get; } = [];
public ImperatorRegionMapper ImperatorRegionMapper { get; private set; }
Expand Down
4 changes: 2 additions & 2 deletions ImperatorToCK3/Mappers/CoA/CoaMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace ImperatorToCK3.Mappers.CoA;

public sealed class CoaMapper {
internal sealed class CoaMapper {
public CoaMapper() { }
public CoaMapper(ModFilesystem modFS) {
Logger.Info("Parsing CoAs...");
Expand Down Expand Up @@ -53,7 +53,7 @@ public void ParseCoAs(IEnumerable<string> coaDefinitionStrings) {
/// <summary>
/// For a given collection of flag names, returns ones that don't have a defined CoA.
/// </summary>
public ISet<string> GetAllMissingFlagKeys(IEnumerable<string> flagKeys) {
public HashSet<string> GetAllMissingFlagKeys(IEnumerable<string> flagKeys) {
var existingFlagKeys = coasMap.Keys.ToHashSet();
return flagKeys.Where(flagKey => !existingFlagKeys.Contains(flagKey)).ToHashSet();
}
Expand Down
2 changes: 1 addition & 1 deletion ImperatorToCK3/Outputter/CoatOfArmsOutputter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace ImperatorToCK3.Outputter;
public static class CoatOfArmsOutputter {
public static async Task OutputCoas(string outputModPath, Title.LandedTitles titles, IEnumerable<Dynasty> dynasties, CoaMapper ck3CoaMapper) {
internal static async Task OutputCoas(string outputModPath, Title.LandedTitles titles, IEnumerable<Dynasty> dynasties, CoaMapper ck3CoaMapper) {
Logger.Info("Outputting coats of arms...");

// Output variables (like "@smCastleX = 0.27" in vanilla CK3).
Expand Down

0 comments on commit 69dfd99

Please sign in to comment.