Exemplo n.º 1
0
        public async Task <IEnumerable <BoardGameElement> > UserGameList(User user, CancellationToken token)
        {
            var request = new UserGameListsRequest
            {
                ClientId = "6XH5yEJAag",
                Username = user.Name
            };

            var listsResponse = await QueryAsync <UserGameListsResponse>(request, GameListRoute, token);

            var games = new List <BoardGameElement>();

            foreach (var list in listsResponse.Lists)
            {
                var listRequest = new GameListRequest
                {
                    ClientId = "6XH5yEJAag",
                    ListId   = list.Id
                };

                var listResponse = await QueryAsync <GameListResponse>(listRequest, SearchRoute, token);

                games.AddRange(listResponse.Games);
            }

            return(games);
        }
Exemplo n.º 2
0
        private async Task GetBoardGames(CancellationToken token)
        {
            var listsRequest = new UserGameListsRequest
            {
                ClientId = "6XH5yEJAag",
                Username = "******"
            };

            var listsResponse = await _boardGameAtlasService.UserGameLists(listsRequest, token);

            var games = new List <BoardGameElement>();

            foreach (var list in listsResponse.Lists)
            {
                var listRequest = new GameListRequest
                {
                    ClientId = "6XH5yEJAag",
                    ListId   = list.Id
                };

                var listResponse = await _boardGameAtlasService.GameList(listRequest, token);

                games.AddRange(listResponse.Games);
            }

            BoardGameList.ItemCollection.Clear();

            AddItems(games);
        }
Exemplo n.º 3
0
 public async Task <UserGameListsResponse> UserGameLists(UserGameListsRequest request, CancellationToken token)
 {
     return(await GetQueryAsync <UserGameListsResponse>(request, GameListRoute, token));
 }