Exemple #1
0
 internal Reply(ReplyTag tag, O result, PString <I> state, ParserError error)
 {
     Tag    = tag;
     Result = result;
     State  = state;
     Error  = error;
 }
Exemple #2
0
        internal Reply(ParserError error)
        {
            Debug.Assert(error != null);

            Tag   = ReplyTag.Error;
            Error = error;
            State = PString <I> .Zero;
        }
Exemple #3
0
        internal Reply(O result, PString <I> state, ParserError error = null)
        {
            Debug.Assert(notnull(result));

            Tag    = ReplyTag.OK;
            State  = state;
            Result = result;
            Error  = error;
        }
Exemple #4
0
            //Returns a topic stage with a topic question and replies for each available stage topic.
            private static Stage GetTopicStage(Conversation conv, List <Stage> tempStages)
            {
                //Create reply array of length 1 longer than topics length
                Reply[] topicReplies = new Reply[tempStages.Count + 1];
                for (int i = 0; i < tempStages.Count; i++)
                {
                    //Create topic replies to select topic
                    ReplyTag tempTag = new ReplyTag(ReplyTag.TagType.ChangeStage, i + 1);
                    topicReplies[i] = new Reply(tempStages[i].Text, 0, tempTag);
                }

                //Create End Reply to exit conversation
                ReplyTag endTag = new ReplyTag(ReplyTag.TagType.End);

                topicReplies[tempStages.Count] = new Reply("End", 0, endTag);

                //Create Line and tag for topic question
                LineTag        lineTag     = new LineTag(LineTag.TagType.TopicQuestion);
                Line           topicLine   = new Line(topicReplies, conv.PrintableText, 0, false, lineTag);
                DialougeBranch topicBranch = new DialougeBranch(topicLine);
                Stage          tempStage   = new Stage(topicBranch);

                return(tempStage);
            }
        private Reply[] GetDefaultFinalReply(ConversationDefualts sentDefaults)
        {
            ReplyTag tempTag = new ReplyTag(ReplyTag.TagType.End);

            return(new Reply[] { new Reply(sentDefaults.endText, 0, tempTag) });
        }