public Speaker( IConversationContext context, int templateID = 9010000, SpeakerParamType param = 0 ) { Context = context; TemplateID = templateID; ParamType = param; }
public AskYesNo( byte speakerTypeID, int speakerTemplateID, SpeakerParamType speakerParam, string text, bool quest ) : base(speakerTypeID, speakerTemplateID, speakerParam) { _text = text; _quest = quest; }
public Task Prompt(Action <ISpeaker, ISpeaker> action, SpeakerParamType param = 0) { var context = new ConversationContext(Socket); var conversation = new ActionConversation( context, new Speaker(context, param: param), new Speaker(context, param: param | SpeakerParamType.NPCReplacedByUser), action ); return(Converse(conversation)); }
public Say( byte speakerTypeID, int speakerTemplateID, SpeakerParamType speakerParam, string text, bool prev, bool next ) : base(speakerTypeID, speakerTemplateID, speakerParam) { _text = text; _prev = prev; _next = next; }
public AskNumber( byte speakerTypeID, int speakerTemplateID, SpeakerParamType speakerParam, string text, int def, int min, int max ) : base(speakerTypeID, speakerTemplateID, speakerParam) { _text = text; _def = def; _min = min; _max = max; }
public AskText( byte speakerTypeID, int speakerTemplateID, SpeakerParamType speakerParam, string text, string textDefault, short lenMin, short lenMax ) : base(speakerTypeID, speakerTemplateID, speakerParam) { _text = text; _textDefault = textDefault; _lenMin = lenMin; _lenMax = lenMax; }
public AskBoxText( byte speakerTypeID, int speakerTemplateID, SpeakerParamType speakerParam, string text, string textDefault, short col, short line ) : base(speakerTypeID, speakerTemplateID, speakerParam) { _text = text; _textDefault = textDefault; _col = col; _line = line; }
public async Task <T> Prompt <T>(Func <ISpeaker, ISpeaker, T> func, SpeakerParamType param = 0) { var error = true; var result = default(T); await Prompt((self, target) => { result = func.Invoke(self, target); error = false; }, param); if (error) { throw new TaskCanceledException(); } return(result); }
public ISpeaker AsSpeaker(int templateID, SpeakerParamType param = 0) => new Speaker(Context, templateID, param);
public Task <T> Prompt <T>(Func <ISpeaker, T> func, SpeakerParamType param = 0) => Prompt((self, target) => func.Invoke(target), param);
public ISpeaker AsSpeaker(SpeakerParamType param = 0) => new Speaker(Context, TemplateID, param);
protected ConversationQuestion(byte speakerTypeID, int speakerTemplateID, SpeakerParamType speakerParam) { SpeakerTypeID = speakerTypeID; SpeakerTemplateID = speakerTemplateID; SpeakerParam = speakerParam; }