public DialogStateMachine( IState currentState, IStatesFactory states, IBotPersistentState persistentState) { _currentState = currentState; _states = states; _persistentState = persistentState; }
private static async Task <DialogStateMachine> DialogStateMachine(IBotPersistentState persistentState, CancellationToken cancellationToken, IStatesFactory states) { return(new DialogStateMachine( states.GetState( await persistentState.ReadCurrentStateAsync(cancellationToken, StateNames.BeforeGameStarts)), states, persistentState )); }
public async Task <MessageActivity> CreateMessageActivityAsync( IBotPersistentState persistentState, IUserPhrase userPhrase, IPlayer player, CancellationToken cancellationToken) { var messageActivity = new MessageActivity( player, new IntentRecognition(userPhrase, player), await DialogStateMachine(persistentState, cancellationToken, new StatesFactory(player))); return(messageActivity); }
public AppDriver() { _activityFactory = new ActivityFactory(); _botPersistentState = new FakeBotPersistentState(); _userPhrase = Substitute.For <IUserPhrase>(); }