public AlexaResponseModel Post(AlexaRequestModel alexaRequestModel) { Thread.CurrentPrincipal = RequestContext.Principal; logger.Info($"Request.Type = {alexaRequestModel.Request.Type}"); AlexaResponseModel alexaResponseModel = null; switch (alexaRequestModel.Request.Type) { case "LaunchRequest": alexaResponseModel = this.intentProvider.LaunchRequest(alexaRequestModel); break; case "IntentRequest": alexaResponseModel = this.intentProvider.IntentRequest(alexaRequestModel); break; case "SessionEndedRequest": alexaResponseModel = this.intentProvider.SessionEndedRequest(alexaRequestModel); break; case "LeaveIntent": alexaResponseModel = this.intentProvider.SessionEndedRequest(alexaRequestModel); break; case "AMAZON.HelpIntent": alexaResponseModel = this.intentProvider.HelpRequest(alexaRequestModel); break; } return(alexaResponseModel); }
private static AlexaResponseModel BuildAlexaResponseModel() { var alexaResponseModel = new AlexaResponseModel(); alexaResponseModel.Response.Card.Title = StaticText.GameTitle; alexaResponseModel.Response.Card.Content = StaticText.PromptForInput; alexaResponseModel.Response.Reprompt.OutputSpeech.Text = StaticText.RepromptForInput; alexaResponseModel.Response.ShouldEndSession = false; return(alexaResponseModel); }
private IntentModel BuildIntentModel(AlexaRequestModel alexaRequestModel, AlexaResponseModel alexaResponseModel) { var playerId = base.CustomPrincipal.PlayerId; var playerDto = base.PlayerRepository.GetPlayer(playerId); var mapDto = base.MapRepository.GetMap(playerDto.MapRefId); var cellDto = base.MapRepository.GetCell(playerDto.MapRefId, playerDto.LocationX, playerDto.LocationY); var intentModel = new IntentModel() { Request = alexaRequestModel, Response = alexaResponseModel, Player = playerDto, Map = mapDto, Cell = cellDto }; return(intentModel); }