public void MergeAchievementsInAchievementList() { var dynamicSoundsAchievment1 = VoicepackSampleCreator.CreateDynamicSoundsAchievement(new string[2, 2] { { "pakSoundPath3", "fileSoundPath3" }, { "pakSoundPath2", "fileSoundPath2" } }); var dynamicSoundsAchievment2 = VoicepackSampleCreator.CreateDynamicSoundsAchievement(new string[2, 2] { { "pakSoundPath1", "fileSoundPath1" }, { "pakSoundPath4", "fileSoundPath4" } }); var dynamicSoundsAchievment3 = VoicepackSampleCreator.CreateDynamicSoundsAchievement(new string[2, 2] { { "pakSoundPath5", "fileSoundPath5" }, { "pakSoundPath6", "fileSoundPath6" } }); var achievementList1 = new XmlDictionary <string, AchievementOptions> { ["key1"] = dynamicSoundsAchievment1, ["key2"] = dynamicSoundsAchievment2 }; var achievementList2 = new XmlDictionary <string, AchievementOptions> { ["key1"] = dynamicSoundsAchievment2, ["key2"] = dynamicSoundsAchievment3 }; VoicepackMerger.MergeAchievementList(achievementList1, achievementList2); var key1ExpectedAchievement = VoicepackSampleCreator.CreateDynamicSoundsAchievement(new string[4, 2] { { "pakSoundPath1", "fileSoundPath1" }, { "pakSoundPath4", "fileSoundPath4" }, { "pakSoundPath3", "fileSoundPath3" }, { "pakSoundPath2", "fileSoundPath2" } }); var key2ExpectedAchievement = VoicepackSampleCreator.CreateDynamicSoundsAchievement(new string[4, 2] { { "pakSoundPath1", "fileSoundPath1" }, { "pakSoundPath4", "fileSoundPath4" }, { "pakSoundPath5", "fileSoundPath5" }, { "pakSoundPath6", "fileSoundPath6" } }); var expectedList = new XmlDictionary <string, AchievementOptions>(); expectedList["key1"] = key1ExpectedAchievement; expectedList["key2"] = key2ExpectedAchievement; Assert.IsTrue(VoicepackComparer.EqualAchievementLists(expectedList, achievementList1)); }
/// <summary> /// Checks if this.voicepack refers to the same sounds as other.voicepack /// </summary> /// <returns>true when equal, false when not equal</returns> public bool EqualSoundFilenames(VoicepackExtended other) { if (!this.IsValidVoicepackLoaded() && !other.IsValidVoicepackLoaded()) { return(true); } if (!this.IsValidVoicepackLoaded() || !other.IsValidVoicepackLoaded()) { return(false); } var achievements = Voicepack.groupManager.achievementList; var otherAchievements = other.Voicepack.groupManager.achievementList; return(VoicepackComparer.EqualAchievementLists(achievements, otherAchievements)); }