using System;
using System.IO;
public static class AppMode
{
/// false = current single-map mode, true = legacy 7-region mode.
public static bool Legacy = false;
public static string CasesCsv
{
get { return SoundWindow.AppFile(Legacy ? "cases_old.csv" : "cases.csv"); }
}
private static string MapDir { get { return Legacy ? "map_old" : "map"; } }
// private static string SoundDir { get { return Legacy ? "sound_old" : "sound"; } }
/// Shared by both modes: legacy and current read from the same folder.
private const string SoundDir = "sound";
/// CSV value -> absolute path. Returns null for "none"/empty.
public static string ResolveMap(string csvValue) { return Resolve(csvValue, MapDir, "map"); }
public static string ResolveSound(string csvValue) { return Resolve(csvValue, SoundDir, "sound"); }
private static string Resolve(string csvValue, string dir, string fallbackDir)
{
if (string.IsNullOrWhiteSpace(csvValue)) return null;
if (csvValue.Trim().Equals("none", StringComparison.OrdinalIgnoreCase)) return null;
string file = Path.GetFileName(csvValue.Trim());
string path = SoundWindow.AppFile(Path.Combine(dir, file));
if (!File.Exists(path) && Legacy) // shared asset fallback
path = SoundWindow.AppFile(Path.Combine(fallbackDir, file));
return path;
}
}