Exemplo n.º 1
0
        //private List<Participant> _participants

        public Smashgg(BracketSettings settings) : base(settings)
        {
            ApiName  = "Smash GG";
            _baseUrl = "https://api.smash.gg/";

            if (settings is SmashGgSettings)
            {
                _settings = settings as SmashGgSettings;
                RetrieveTournamentId();
            }
        }
Exemplo n.º 2
0
        private void InitializeBracketApiList()
        {
            Type[] apis = Assembly.GetExecutingAssembly().GetTypes().Where((t) => t.IsSubclassOf(typeof(BracketApi))).ToArray();
            ApiList = new ObservableCollection <string>();
            foreach (var type in apis)
            {
                BracketSettings s = new BracketSettings();
                BracketApi      a = Activator.CreateInstance(type, s) as BracketApi;
                ApiList.Add(a.ApiName);

                if (type == Configuration.Instance.Stream?.GetType())
                {
                    SelectedApi = ApiList.Count - 1;
                }
            }
        }
Exemplo n.º 3
0
        public SmashggGraphQL(BracketSettings settings) : base(settings)
        {
            ApiName  = "smash.gg (GraphQL)";
            _baseUrl = "https://api.smash.gg/gql/alpha";

            if (settings is SmashGgGQLSettings s)
            {
                _settings = s;
            }
            else
            {
                _settings = new SmashGgGQLSettings();
            }

            _headers.Add("Authorization", "Bearer " + _settings.ApiKey);
        }