我正在尝试实现从一个操作读取用户输入并在其他屏幕中读取,例如:
user: xx
Bixby: who's there?
user: yyy
Bixby: yyy who?
I am able to read user input yyy but unable to pass in different actions to display yyy who.
您能否帮助或指导我做错了什么或做这种胶囊的最佳方法是什么?
提前致谢。
我正在尝试实现从一个操作读取用户输入并在其他屏幕中读取,例如:
user: xx
Bixby: who's there?
user: yyy
Bixby: yyy who?
I am able to read user input yyy but unable to pass in different actions to display yyy who.
您能否帮助或指导我做错了什么或做这种胶囊的最佳方法是什么?
提前致谢。
这就是我将如何模拟您可能试图实现的行为。
Concepts
- Joke
- JokeQuestion (posed by 'Bixby')
- JokeAnswer (answered by User)
Views
- JokeResultView
- JokeAnswerInputView
Layouts
- JokeLayout
- JokeQuestionLayout
- JokeAnswerLayout
Action (all of these Actions take Joke as input AND output the Joke back)
- GetJokeAnswerFromUser (get an Answer concept from the user and update the Interaction concept)
- ShowJokeQuestionToUser (show the next JokeQuestion to the user)
Other Actions as needed?
通过这种安排,您始终可以通过 Joke Concept 访问 JokeQuestion(s) 和 JokeAnswer(s)。JokeResultView 将驱动用户在屏幕上看到的内容,您可以在您的实现中构建某种逻辑来表示笑话的开始和结束等。
试试这个,看看它是否有帮助。