Ejemplo n.º 1
0
 public Configuration(string filename)
 {
     if (File.Exists(filename))
     {
         Config = JsonConvert.DeserializeObject <ClientCredentialsGrant>(File.ReadAllText(filename));
     }
     else
     {
         Config = TUICfg.ClientCfg();
         File.WriteAllText(filename, JsonConvert.SerializeObject(Config, Formatting.Indented));
     }
 }
Ejemplo n.º 2
0
 public PlayerConfig(string filename)
 {
     if (File.Exists(filename))
     {
         Player = JsonConvert.DeserializeObject <PlayerInfo>(File.ReadAllText(filename));
     }
     else
     {
         Player = TUICfg.PlayerCfg();
         File.WriteAllText(filename, JsonConvert.SerializeObject(Player, Formatting.Indented));
     }
 }