예제 #1
0
 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/"));
 }
예제 #2
0
 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());
 }
예제 #3
0
 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/"));
 }
예제 #4
0
        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/"));
        }