Skip to content

Commit

Permalink
Handle hoi4 map modes
Browse files Browse the repository at this point in the history
  • Loading branch information
bcssov committed Feb 4, 2023
1 parent 37e4bbd commit 164e09e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
7 changes: 6 additions & 1 deletion src/IronyModManager.Parser.Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 02-16-2020
//
// Last Modified By : Mario
// Last Modified On : 10-14-2022
// Last Modified On : 02-04-2023
// ***********************************************************************
// <copyright file="Constants.cs" company="Mario">
// Mario
Expand Down Expand Up @@ -269,6 +269,11 @@ public static class HOI4
/// </summary>
public static readonly string IntelligenceAgencies = MergePath(CommonPath, "intelligence_agencies");

/// <summary>
/// The map modes
/// </summary>
public static readonly string MapModes = MergePath(CommonPath, "map_modes");

/// <summary>
/// The medals
/// </summary>
Expand Down
17 changes: 16 additions & 1 deletion src/IronyModManager.Parser.Tests/HOI4InnerLayerParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 01-29-2022
//
// Last Modified By : Mario
// Last Modified On : 01-29-2022
// Last Modified On : 02-04-2023
// ***********************************************************************
// <copyright file="HOI4InnerLayerParserTests.cs" company="Mario">
// Mario
Expand Down Expand Up @@ -329,6 +329,21 @@ public void CanParse_unit_medals_should_be_true()
parser.CanParse(args).Should().BeTrue();
}

/// <summary>
/// Defines the test method CanParse_map_modes_should_be_true.
/// </summary>
[Fact]
public void CanParse_map_modes_should_be_true()
{
var args = new CanParseArgs()
{
File = "common\\map_modes\\test.txt",
GameType = "HeartsofIronIV"
};
var parser = new Games.HOI4.InnerLayerParser(new CodeParser(new Logger()), null);
parser.CanParse(args).Should().BeTrue();
}

/// <summary>
/// Defines the test method Parse_should_yield_results.
/// </summary>
Expand Down
5 changes: 3 additions & 2 deletions src/IronyModManager.Parser/Games/HOI4/InnerLayerParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 01-29-2022
//
// Last Modified By : Mario
// Last Modified On : 09-27-2022
// Last Modified On : 02-04-2023
// ***********************************************************************
// <copyright file="InnerLayerParser.cs" company="Mario">
// Mario
Expand Down Expand Up @@ -52,7 +52,8 @@ public class InnerLayerParser : BaseParser, IGameParser
Common.Constants.HOI4.CountryLeader, Common.Constants.HOI4.Aces,
Common.Constants.HOI4.AIAreas, Common.Constants.HOI4.Buildings, Common.Constants.HOI4.Ideologies,
Common.Constants.HOI4.Resources, Common.Constants.HOI4.Wargoals, Common.Constants.HOI4.ScriptedDiplomaticActions,
Common.Constants.HOI4.Medals, Common.Constants.HOI4.Ribbons, Common.Constants.HOI4.UnitMedals
Common.Constants.HOI4.Medals, Common.Constants.HOI4.Ribbons, Common.Constants.HOI4.UnitMedals,
Common.Constants.HOI4.MapModes
};

#endregion Fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 02-12-2020
//
// Last Modified By : Mario
// Last Modified On : 12-04-2022
// Last Modified On : 02-04-2023
// ***********************************************************************
// <copyright file="GameRegistration.cs" company="Mario">
// Mario
Expand Down Expand Up @@ -184,7 +184,7 @@ private IGameType GetHOI4(string baseUserDir)
game.ParadoxGameId = Shared.Constants.GamesTypes.HeartsOfIron4.ParadoxGameId;
game.SupportedMergeTypes = IronyModManager.Models.Common.SupportedMergeTypes.Zip | IronyModManager.Models.Common.SupportedMergeTypes.Basic;
game.ModDescriptorType = IronyModManager.Models.Common.ModDescriptorType.DescriptorMod;
game.GameIndexCacheVersion = 5;
game.GameIndexCacheVersion = 6;
MapGameSettings(game, GetExecutableSettings(game));
return game;
}
Expand Down

0 comments on commit 164e09e

Please sign in to comment.