/// <summary>
    /// Updates the gamestrings of <paramref name="heroSkin"/>.
    /// </summary>
    /// <param name="heroSkin">The data who's gamestrings will be updated.</param>
    /// <param name="version">The version directory to load the gamestrings from.</param>
    /// <param name="localization">The <see cref="Localization"/> of the gamestrings.</param>
    /// <exception cref="ArgumentNullException"><paramref name="heroSkin"/> is null.</exception>
    /// <exception cref="ArgumentNullException"><paramref name="version"/> is null.</exception>
    public void UpdateGameString(HeroSkin heroSkin, HeroesDataVersion version, Localization localization)
    {
        ArgumentNullException.ThrowIfNull(heroSkin, nameof(heroSkin));
        ArgumentNullException.ThrowIfNull(version, nameof(version));

        (_, string gameStringPath) = GetDataAndGameStringPaths(version, true, localization, _heroSkinFileTemplateName, false, true);

        using GameStringDocument gameStringDocument = GameStringDocument.Parse(gameStringPath);

        heroSkin.UpdateGameStrings(gameStringDocument);
    }
Beispiel #2
0
        public void UpdateGameStringsTest()
        {
            using GameStringDocument gameStringDocument = GameStringDocument.Parse(LoadEnusLocalizedStringData());

            HeroSkin heroSkin = new HeroSkin
            {
                Id = "AbathurBaseVar3",
            };

            heroSkin.UpdateGameStrings(gameStringDocument);

            Assert.AreEqual("Abathur, the Evolution Master of Kerrigan's Swarm, works ceaselessly to improve the zerg from the genetic level up. His hate for chaos and imperfection almost rivals his hatred of pronouns.", heroSkin.InfoText !.RawDescription);
        }