示例#1
0
        internal static RestGame Create(BaseTwitchClient client, Model model)
        {
            var entity = new RestGame(client, model.Id);

            entity.Update(model);
            return(entity);
        }
示例#2
0
        public static async Task <IReadOnlyCollection <RestGame> > FindGamesAsync(BaseTwitchClient client, string query, bool islive, RequestOptions options = null)
        {
            var model = await client.ApiClient.FindGamesAsync(query, islive, options).ConfigureAwait(false);

            if (model.Games != null)
            {
                return(model.Games.Select(x => RestGame.Create(client, x)).ToArray());
            }
            return(null);
        }
示例#3
0
        internal static async Task <IReadOnlyCollection <RestGame> > SearchGamesAsync(BaseRestClient client, string query, bool islive)
        {
            var token = TokenHelper.GetSingleToken(client);
            var model = await client.RestClient.SearchGamesInternalAsync(token, query, islive);

            if (model == null)
            {
                return(new List <RestGame>());
            }

            var entity = model.Games.Select(x => RestGame.Create(client, x));

            return(entity.ToArray());
        }
示例#4
0
 public int GetHashCode(RestGame obj)
 => obj.GetHashCode();
示例#5
0
 public bool Equals(RestGame x, RestGame y)
 => x.Id == y.Id;