1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
//! Messages exchanged between the dialogue runner and the game.
//!
//! Messages come in two directions:
//! - *outbound*: [`DialogueLine`], [`DialogueCommand`], [`DialogueChoices`] and
//! [`DialogueFinished`] are
//! sent by a [`DialogueRunner`] to report what the dialogue virtual machine
//! produced.
//! - *inbound*: [`StartDialogue`] and [`ResumeDialogue`] are sent to a
//! [`DialogueRunner`] to enter a node, then to drive it forward every time it
//! is waiting for the player.
//!
//! Every message carries the [`Entity`] holding the [`DialogueRunner`] it belongs
//! to, so several dialogues can run at the same time.
//!
//! [`DialogueRunner`]: crate::runner::DialogueRunner
use ;
use ;
use crateDialogueToken;
/// A line of dialogue is ready to be displayed.
///
/// Sent by a [`DialogueRunner`] when the virtual machine yields
/// [`DialogueEvent::Say`]. The dialogue stays suspended until a
/// [`ResumeDialogue`] with [`ResumeInput::Advance`] is sent back for the same
/// runner.
///
/// [`DialogueRunner`]: crate::runner::DialogueRunner
/// [`DialogueEvent::Say`]: replique::vm::DialogueEvent::Say
/// The dialogue reached a `>>` command.
///
/// Sent by a [`DialogueRunner`] when the virtual machine yields
/// [`DialogueEvent::Command`]. What the command does is up to the game; the
/// dialogue stays suspended until a [`ResumeDialogue`] with
/// [`ResumeInput::Advance`] is sent back for the same runner, so an animation
/// or a sound can run to completion first.
///
/// [`DialogueRunner`]: crate::runner::DialogueRunner
/// [`DialogueEvent::Command`]: replique::vm::DialogueEvent::Command
/// The dialogue reached a choice point and waits for input.
///
/// Sent by a [`DialogueRunner`] when the virtual machine yields
/// [`DialogueEvent::Choices`]. The dialogue stays suspended until a
/// [`ResumeDialogue`] with [`ResumeInput::Select`] is sent back for the same
/// runner.
///
/// [`DialogueRunner`]: crate::runner::DialogueRunner
/// [`DialogueEvent::Choices`]: replique::vm::DialogueEvent::Choices
/// A single option of a [`DialogueChoices`].
/// The dialogue reached its end.
///
/// Sent by a [`DialogueRunner`] when the virtual machine yields
/// [`DialogueEvent::Finished`]. No further message will be sent for this runner
/// until a new [`StartDialogue`] is sent.
///
/// [`DialogueRunner`]: crate::runner::DialogueRunner
/// [`DialogueEvent::Finished`]: replique::vm::DialogueEvent::Finished
/// Ask a [`DialogueRunner`] to enter a dialogue node.
///
/// The runner runs the node until it produces a [`DialogueLine`], a
/// [`DialogueChoices`] or a [`DialogueFinished`]. Only a runner that has not
/// started yet, or whose previous dialogue is finished, can be started; the
/// runner reports an error otherwise.
///
/// [`DialogueRunner`]: crate::runner::DialogueRunner
/// How a suspended dialogue is resumed.
///
/// The variant must match what the runner is waiting on, otherwise the runner
/// reports an error and the dialogue stays suspended.
/// Ask a [`DialogueRunner`] suspended on a [`DialogueLine`] or a
/// [`DialogueChoices`] to carry on.
///
/// The runner runs until the next [`DialogueLine`], [`DialogueChoices`] or
/// [`DialogueFinished`].
///
/// [`DialogueRunner`]: crate::runner::DialogueRunner