我正在尝试实现从一项操作中读取用户输入并在其他屏幕中读取,例如:
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.
请问您能帮忙或指导我做错了什么,还是做这种胶囊的最佳方法是什么?
谢谢。
答案 0 :(得分:1)
这就是我如何对可能要实现的行为进行建模的方法。
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和JokeAnswer。 JokeResultView将驱动用户在屏幕上看到的内容,并且您可以在实现中构建某种逻辑来表示Joke的开始和结束等。
尝试一下,看看是否有帮助。