Пример #1
0
 public Pokemon.Bases.Nature this[uint index]
 {
     get
     {
         if (Cacher.HasEntry(URL.Replace("/", ""), (int)index))
         {
             return(JsonConvert.DeserializeObject <Pokemon.Bases.Nature>(System.IO.File.ReadAllText(Cacher.Read(URL.Replace("/", ""), (int)index))));
         }
         else
         {
             var obj = JsonConvert.DeserializeObject <Pokemon.Bases.Nature>(WebConnector.Request(SingleURL(index)));
             Cacher.Cache(URL.Replace("/", ""), (int)index, obj);
             return(obj);
         }
     }
 }
Пример #2
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);
         }
     }
 }
Пример #3
0
        public Primatives.EndpointBase All(uint limit, uint offset)
        {
            //Check cache

            var obj = Newtonsoft.Json.JsonConvert.DeserializeObject <Primatives.EndpointBase>(WebConnector.Request(Domain + URL, new System.Collections.Specialized.NameValueCollection()
            {
                { "limit", limit.ToString() },
                { "offset", offset.ToString() }
            }));

            return(obj);
        }