public async Task <Game> GetGame(int gameId)
        {
            HttpClientResponse response = new HttpClientResponse();
            await response.Convert(HttpClientRequestService.Get($"games/{gameId}"));

            return(new GameJsonService().ToObject(response.ResponseContent));
        }
        // Get all loot that is linked to a game
        public async Task <List <Loot> > GetAll(int gameId)
        {
            var response = new HttpClientResponse()
            {
                HasMultipleResults = true,
            };
            await response.Convert(HttpClientRequestService.Get($"games/{gameId}/loot"));

            var result = new List <Loot>(
                new LootJsonService().ToObjects(response.ResponseContent)
                );

            return(result);
        }
        public async Task <Player> GetUser(int userId, int gameId)
        {
            HttpClientResponse response = new HttpClientResponse();
            await response.Convert(HttpClientRequestService.Get($"users/{userId}"));

            if (response.Status == System.Net.HttpStatusCode.NotFound)
            {
                return(null);
            }

            var user = new PlayerJsonService().ToObject(response.ResponseContent);

            user.InviteKey.GameId = gameId;

            return(user.ToPlayer());
        }
        public async Task <List <InviteKey> > GetAll(string inviteCode)
        {
            var response = new HttpClientResponse();
            await response.Convert(HttpClientRequestService.Get($"invite-keys/{inviteCode}"));

            List <InviteKey> result = new List <InviteKey>();

            InviteKey key = new InviteKeyJsonService().ToObject(response.ResponseContent);

            key.Value = inviteCode;
            if (string.IsNullOrEmpty(key.Role))
            {
                key.ErrorMessages = response.ErrorMessages.Count() > 0 ? response.ErrorMessages : new Dictionary <string, string>()
                {
                    { "value", response.Status == HttpStatusCode.NotFound ? "De code is niet gevonden" : "Er is iets misgegaan" }
                };
            }

            result.Add(key);
            return(result);
        }