Exemplo n.º 1
0
        public async override Task <ResponseModel> Act(string message, LogicBlock.Session.ChatSession session)
        {
            var result = new ResponseModel();

            switch (message)
            {
            case "/arcade":
                session.State  = State.ArcadeAction;
                result.Message = (await _translation.GetText("start_arcade")).Russian;
                break;

            case "/tutorial":
                session.State  = State.TutorialAction;
                result.Message = (await _translation.GetText("start_tutorial")).Russian;
                break;

            default:
                result.Message = (await _translation.GetText("choose_mode")).Russian;
                break;
            }
            ;

            result.Session = session;
            return(result);
        }
Exemplo n.º 2
0
        public override async Task <ResponseModel> Act(string message, LogicBlock.Session.ChatSession session)
        {
            var result = new ResponseModel();

            IResponseInfo responseInfo;

            if (session.WordSequence == null)
            {
                StartRequestInfo info = new StartRequestInfo
                {
                    Request = new StartRequest(session)
                };

                responseInfo = await _logic.StartChat(info);
            }
            else
            {
                TextRequestInfo info = new TextRequestInfo
                {
                    Request = new TextRequest(session, message)
                };

                responseInfo = await _logic.HandleText(info);
            }

            result.Message = responseInfo.Message;
            result.Session = session;
            result.Success = responseInfo.ResponseCode == ResponseCodes.OK;

            return(result);
        }
Exemplo n.º 3
0
        public async override Task <ResponseModel> Act(string message, LogicBlock.Session.ChatSession session)
        {
            var result = new ResponseModel();

            if (_languageList.Contains(message))
            {
                session.Language = message;
                session.State    = State.ModeChoose;
                result.Message   = (await _translation.GetText("choose_mode")).Russian;
            }
            else
            {
                result.Message = (await _translation.GetText("language_list")).Russian;
            }

            result.Session = session;
            return(result);
        }