/// <summary> /// Get ChaFiles that are related to this heroine. Warning: It might not return some copies. /// </summary> public static IEnumerable <ChaFileControl> GetRelatedChaFiles(this SaveData.Heroine heroine) { if (heroine == null) { throw new ArgumentNullException(nameof(heroine)); } var results = new HashSet <ChaFileControl>(); if (heroine.charFile != null) { results.Add(heroine.charFile); } if (heroine.chaCtrl != null && heroine.chaCtrl.chaFile != null) { results.Add(heroine.chaCtrl.chaFile); } var npc = heroine.GetNPC(); if (npc != null && npc.chaCtrl != null && npc.chaCtrl.chaFile != null) { results.Add(npc.chaCtrl.chaFile); } return(results); }