/// <summary>
    /// Updates the gamestrings of <paramref name="spray"/>.
    /// </summary>
    /// <param name="spray">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="spray"/> is null.</exception>
    /// <exception cref="ArgumentNullException"><paramref name="version"/> is null.</exception>
    public void UpdateGameString(Spray spray, HeroesDataVersion version, Localization localization)
    {
        ArgumentNullException.ThrowIfNull(spray, nameof(spray));
        ArgumentNullException.ThrowIfNull(version, nameof(version));

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

        using GameStringDocument gameStringDocument = GameStringDocument.Parse(gameStringPath);

        spray.UpdateGameStrings(gameStringDocument);
    }
예제 #2
0
        public void UpdateGameStringsTest()
        {
            using GameStringDocument gameStringDocument = GameStringDocument.Parse(LoadEnusLocalizedStringData());

            Spray spray = new Spray
            {
                Id = "SprayAnimatedCarbotsAlarakDark",
            };

            spray.UpdateGameStrings(gameStringDocument);

            Assert.AreEqual(string.Empty, spray.Description !.RawDescription);
        }