Helper method for path manager

This commit is contained in:
adelikat 2014-08-13 17:50:24 +00:00
parent c0defce472
commit e29e4a1227
1 changed files with 22 additions and 0 deletions

View File

@ -378,5 +378,27 @@ namespace BizHawk.Client.Common
return false;
}
/// <summary>
/// Don't only valid system ids to system ID, pathType is ROM, Screenshot, etc
/// Returns the desired path, if does not exist, returns platform base, else it returns base
/// </summary>
/// <param name="pathType"></param>
/// <param name="systemID"></param>
public PathEntry GetPathEntryWIthFallback(string pathType, string systemID)
{
var entry = Global.Config.PathEntries[systemID, pathType];
if (entry == null)
{
entry = Global.Config.PathEntries[systemID, "Base"];
}
if (entry == null)
{
entry = Global.Config.PathEntries["Global", "Base"];
}
return entry;
}
}
}