namespace Backend; public sealed class LanderConfig { public string CliPath { get; set; } = "publish/GameCli/GameCli"; public string ModelPath { get; set; } = "models/ppo_lander.onnx"; } /// /// Walks up from to find the repo root /// (marker file: GameCli.sln) and resolves the configured paths against it. /// public static class PathResolver { public static string RepoRoot() { var dir = AppContext.BaseDirectory; while (dir is not null) { if (File.Exists(Path.Combine(dir, "GameCli.sln"))) return dir; var parent = Directory.GetParent(dir); if (parent is null) break; dir = parent.FullName; } throw new InvalidOperationException( "could not locate repo root (no GameCli.sln found in any ancestor)"); } public static string Resolve(string relativeOrAbsolute) { if (Path.IsPathRooted(relativeOrAbsolute)) return relativeOrAbsolute; return Path.GetFullPath(Path.Combine(RepoRoot(), relativeOrAbsolute)); } }