示例#1
0
        public HaloAPIService(string apiToken, string baseApiUrl = BaseApiUrl, IApiCacheManager apiCache = null)
        {
            Endpoints.Halo5.MajorPrefix = baseApiUrl;

            RequestRateHttpClient.SetAPIToken(apiToken);
            if (apiCache == null)
            {
                apiCache = SingletonCacheManager.Instance;
            }
            _responseProcessor = new ResponseProcessor(apiCache);
            HaloWars2          = new HaloWars2APIService(_responseProcessor, baseApiUrl, apiCache);
        }
示例#2
0
 public HaloAPIService(HaloAPIConfig config, IApiCacheManager apiCache = null)
 {
     Endpoints.Halo5.MajorPrefix = config.BaseApiUrl;
     _statCacheExpiry            = config.StatCacheExpiry;
     _profileCacheExpiry         = config.ProfileCacheExpiry;
     _ugcCacheExpiry             = config.UGCCacheExpiry;
     RequestRateHttpClient.SetAPIToken(config.APIToken);
     if (apiCache == null && config.UseDefaultCache)
     {
         apiCache = SingletonCacheManager.Instance;
     }
     _responseProcessor = new ResponseProcessor(apiCache);
     HaloWars2          = new HaloWars2APIService(_responseProcessor, config.APIToken, apiCache);
 }
示例#3
0
 public HaloAPIService(string apiToken, string baseApiUrl = "https://www.haloapi.com")
 {
     Endpoints.MajorPrefix = baseApiUrl;
     RequestRateHttpClient.SetAPIToken(apiToken);
     _responseProcessor = new ResponseProcessor();
 }
示例#4
0
 public HaloWars2APIService(ResponseProcessor responseProcessor, string baseApiUrl = BaseApiUrl, IApiCacheManager apiCache = null)
 {
     Endpoints.HaloWars2.MajorPrefix = baseApiUrl;
     _responseProcessor = responseProcessor;
 }