/// <summary> /// Updates the gamestrings of <paramref name="rewardPortrait"/>. /// </summary> /// <param name="rewardPortrait">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="rewardPortrait"/> is null.</exception> /// <exception cref="ArgumentNullException"><paramref name="version"/> is null.</exception> public void UpdateGameString(RewardPortrait rewardPortrait, HeroesDataVersion version, Localization localization) { ArgumentNullException.ThrowIfNull(rewardPortrait, nameof(rewardPortrait)); ArgumentNullException.ThrowIfNull(version, nameof(version)); (_, string gameStringPath) = GetDataAndGameStringPaths(version, true, localization, _rewardPortraitFileTemplateName, false, true); using GameStringDocument gameStringDocument = GameStringDocument.Parse(gameStringPath); rewardPortrait.UpdateGameStrings(gameStringDocument); }
public void UpdateGameStringsTest() { using GameStringDocument gameStringDocument = GameStringDocument.Parse(LoadEnusLocalizedStringData()); RewardPortrait rewardPortrait = new RewardPortrait { Id = "1YearAnniversaryPortrait", }; rewardPortrait.UpdateGameStrings(gameStringDocument); Assert.AreEqual("1 Year Anniversary Portrait", rewardPortrait.Name); }