public string GetNameFromGroup(SourceGroup sourceGroup, string prefix, string separator = "_") { var segments = (sourceGroup.Name ?? sourceGroup.RawValue).Split('_'); var parts = segments.Select(s => Constants.AllItemNames.TryGetValue(s, out var name) ? name : s).ToList(); parts.AddIfSet(prefix); return(string.Join(separator, parts).MakeSafe(true)); }
public string GetNameFromGroup <T>(SourceGroup sourceGroup, T ident, BuildSettings settings, string separator = "_") where T : Identifier { if (ident is SkinIdentifier sIdent) { var parts = new List <string> { sIdent.GetAircraftName(), $"Skin{sIdent.Slot.GetSlotNumber()}" }; parts.AddIfSet(settings.Prefix); return(string.Join(separator, parts).MakeSafe(true)); } else { return(GetNameFromGroup(sourceGroup, settings.Prefix, separator)); } }