/// <summary> /// Returns default directory name for given <paramref name="dlc"/>. /// </summary> /// <param name="dlc">AppId of a DLC.</param> /// <returns>Default directory name for DLC.</returns> /// <exception cref="UnsupportedDlcException">Thrown when default directory name is not available for given <paramref name="dlc"/>.</exception> public static string GetName(DlcAppId dlc) { return(dlc switch { DlcAppId.Unknown => throw new UnsupportedDlcException(DlcAppId.Unknown), DlcAppId.Csla => Csla, DlcAppId.Gm => Gm, DlcAppId.Sog => Sog, _ => throw new UnsupportedDlcException(dlc) });
private static string GetDefaultMessage(DlcAppId dlc) => $"DLC {dlc} is not supported.";
public UnsupportedDlcException(DlcAppId dlc, string message) : base(message) { Dlc = dlc; }
public UnsupportedDlcException(DlcAppId dlc) : this(dlc, GetDefaultMessage(dlc)) { }