private string GetSavePath(CustomJPrototypeResolver resolver, JObject instructions, JObject blueprint, string instructionsDir, string savePath, string saveName, int item, HashSet <string> savedPaths) { var extension = resolver.GetStringOrDefault(blueprint, "SavePathExtension", ""); var path = saveName.Contains("~") ? PathX.Build(instructionsDir, savePath + extension, $"{resolver.GetString(instructions, "SaveName")}.png") : PathX.Build(instructionsDir, savePath + extension, $"{saveName}{item}.png"); if (savedPaths.Contains(path)) { Console.WriteLine($"Duplicate Save Path Detected: {path}"); throw new ArgumentException(); } savedPaths.Add(path); return(path); }
public static JObject FromFile(params string[] pathSegments) => FromFile(PathX.Build(pathSegments));