Exemplo n.º 1
0
 public ClientCR(CRConfig config, ILogger logger = null)
 {
     Config       = config;
     Logger       = logger;
     _credentials = new BearerCredentials(Config.Token);
     Player       = GetPlayer();
     Clan         = GetClan();
     Cards        = GetCards();
 }
Exemplo n.º 2
0
        public static void Load()
        {
            var uri      = AppDomain.CurrentDomain.BaseDirectory.Split('\\');
            var pathtest = "";

            for (int i = 0; i < uri.Length; i++)
            {
                pathtest = Path.Combine(pathtest, uri[i] + "\\");
                var filejson = Path.Combine(pathtest, FilePath);
                if (File.Exists(filejson))
                {
                    CRConfig = JsonConvert.DeserializeObject <CRConfig>(File.ReadAllText(filejson));
                    break;
                }
            }

            if (CRConfig == null)
            {
                CRConfig = new CRConfig();
            }
        }