public static Inventory GetInventory(bool prettyPrint = false) { JSONHelper.CreateFolder("Diplomata/"); if (!JSONHelper.Exists("inventory", "Diplomata/")) { JSONHelper.Create(new Inventory(), "inventory", prettyPrint, "Diplomata/"); } return(JSONHelper.Read <Inventory>("inventory", "Diplomata/")); }
public static Quest[] GetQuests(bool prettyPrint = false) { JSONHelper.CreateFolder("Diplomata/"); if (!JSONHelper.Exists("quests", "Diplomata/")) { JSONHelper.Create(new Quests(), "quests", prettyPrint, "Diplomata/"); } return(JSONHelper.Read <Quests>("quests", "Diplomata/").GetQuests()); }
public static Options GetOptions() { JSONHelper.CreateFolder("Diplomata/"); if (!JSONHelper.Exists("preferences", "Diplomata/")) { JSONHelper.Create(new Options(), "preferences", false, "Diplomata/"); } return(JSONHelper.Read <Options>("preferences", "Diplomata/")); }
public static GlobalFlags GetGlobalFlags(bool prettyPrint = false) { JSONHelper.CreateFolder("Diplomata/"); // Rename legacy custom flags files. if (JSONHelper.Exists("customFlags", "Diplomata/")) { var globalFlags = JSONHelper.Read <GlobalFlags>("customFlags", "Diplomata/"); JSONHelper.Create(globalFlags, "globalFlags", prettyPrint, "Diplomata/"); JSONHelper.Delete("customFlags", "Diplomata/"); } // Create global flags file if don't exists. if (!JSONHelper.Exists("globalFlags", "Diplomata/")) { JSONHelper.Create(new GlobalFlags(), "globalFlags", prettyPrint, "Diplomata/"); } // Return the global flags file. return(JSONHelper.Read <GlobalFlags>("globalFlags", "Diplomata/")); }
public static List <Character> GetCharacters(Options options) { JSONHelper.CreateFolder("Diplomata/Characters/"); GlobalFlagsController.GetGlobalFlags(options.jsonPrettyPrint); return(UpdateList(options)); }