pub struct Line {
pub id: String,
pub substitutions: Vec<String>,
}Expand description
A line of dialogue, sent from the VirtualMachine to the game.
When the game receives a Line, it should do the following things to prepare the line for
presentation to the user.
-
Use the value in the
idfield to look up the appropriate user-facing text in the string table. -
For each of the entries in the
substitutionsfield, replace the corresponding placeholder with the entry. That is, the text “{0}” should be replaced with the value ofsubstitutions[0], “{1}” withsubstitutions[1], and so on. -
Use
expand_format_functionsto expand all format functions in the line.
You do not create instances of this struct yourself. They are created by the VirtualMachine
during program execution.
Fields§
§id: String§substitutions: Vec<String>Trait Implementations§
Auto Trait Implementations§
impl Freeze for Line
impl RefUnwindSafe for Line
impl Send for Line
impl Sync for Line
impl Unpin for Line
impl UnwindSafe for Line
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more