Skip to content

Class: MockPhraseDialog

Mock of the X-Ray engine dialog phrase container.

Implements

  • CPhraseDialog

Constructors

Constructor

ts
new MockPhraseDialog(): MockPhraseDialog;

Returns

MockPhraseDialog

Methods

asMock()

ts
asMock(): CPhraseDialog;

Returns

CPhraseDialog


create()

ts
static create(): MockPhraseDialog;

Returns

MockPhraseDialog


mock()

ts
static mock(dialog?: MockPhraseDialog): CPhraseDialog;

Parameters

ParameterType
dialogMockPhraseDialog

Returns

CPhraseDialog

Properties

AddPhrase

ts
AddPhrase: Mock<(text: string, phraseId: string, prevPhraseId: string, goodwillLevel: number) => MockPhrase>;

Add a phrase to the dialog tree.

Remarks

prev_phrase_id creates the edge from the previous phrase to the new one. Pass an empty string for a root phrase. Reusing an existing phrase_id returns the existing phrase and still links it from prev_phrase_id.

Param

text

Text or string table id.

Param

phrase_id

New phrase id.

Param

prev_phrase_id

Parent phrase id, or an empty string.

Param

goodwill_level

Goodwill value used when the engine orders available replies.

Returns

Created phrase.

Implementation of

ts
CPhraseDialog.AddPhrase

GetPhrase

ts
GetPhrase: Mock<(id: string) => MockPhrase>;

list

ts
list: Record<string, MockPhrase> = {};