Пример #1
0
 public Encounter.Bases.ConditionValue this[uint index]
 {
     get
     {
         if (Cacher.HasEntry(URL.Replace("/", ""), (int)index))
         {
             return(JsonConvert.DeserializeObject <Encounter.Bases.ConditionValue>(System.IO.File.ReadAllText(Cacher.Read(URL.Replace("/", ""), (int)index))));
         }
         else
         {
             var obj = JsonConvert.DeserializeObject <Encounter.Bases.ConditionValue>(WebConnector.Request(SingleURL(index)));
             Cacher.Cache(URL.Replace("/", ""), (int)index, obj);
             return(obj);
         }
     }
 }
Пример #2
0
 public Pokemon.Bases.PokeathlonStat this[uint index]
 {
     get
     {
         if (Cacher.HasEntry(URL.Replace("/", ""), (int)index))
         {
             return(JsonConvert.DeserializeObject <Pokemon.Bases.PokeathlonStat>(System.IO.File.ReadAllText(Cacher.Read(URL.Replace("/", ""), (int)index))));
         }
         else
         {
             var obj = JsonConvert.DeserializeObject <Pokemon.Bases.PokeathlonStat>(WebConnector.Request(SingleURL(index)));
             Cacher.Cache(URL.Replace("/", ""), (int)index, obj);
             return(obj);
         }
     }
 }
Пример #3
0
 public Contest.Bases.Effect this[uint index]
 {
     get
     {
         if (Cacher.HasEntry(URL.Replace("/", ""), -1))
         {
             return(Newtonsoft.Json.JsonConvert.DeserializeObject <Contest.Bases.Effect>(System.IO.File.ReadAllText(Cacher.Read(URL.Replace("/", ""), -1))));
         }
         else
         {
             var obj = JsonConvert.DeserializeObject <Contest.Bases.Effect>(WebConnector.Request(SingleURL(index)));
             Cacher.Cache(URL.Replace("/", ""), (int)index, obj);
             return(obj);
         }
     }
 }