Exemplo n.º 1
0
        private async Task <MatchDetails> RunChangeServerAsync(string matchId)
        {
            var matchDetails = await _tennisGameGateway.GetAsync(matchId);

            switch (matchDetails.ServingPlayer)
            {
            case 1:
            case 2:
                matchDetails.ServingPlayer = matchDetails.ServingPlayer == 1 ? 2 : 1;
                var updatedDetails = await _tennisGameGateway.UpdateAsync(matchDetails);

                return(updatedDetails);

            default:
                return(matchDetails);
            }
        }
 public Task <MatchDetails> GetTennisMatchDetails(string id)
 {
     return(_tennisGameGateway.GetAsync(id));
 }