pub struct SourceText {
pub data: BTreeMap<String, String>,
pub lines: BTreeMap<String, SourceLine>,
pub names: Names,
}Expand description
Today’s English for everything data.ron and dialogue/*.ron can
translate, by key.
Fields§
§data: BTreeMap<String, String>Data text by key: names.<id> for the names table, and whatever
else the game hands over (items.<id>.name, say).
lines: BTreeMap<String, SourceLine>Dialogue lines by line id, and captions by caption_key.
names: NamesThe names table: what a name token in a pack’s text may refer to.
Implementations§
Source§impl SourceText
impl SourceText
Sourcepub fn new(data: BTreeMap<String, String>, names: Names) -> Self
pub fn new(data: BTreeMap<String, String>, names: Names) -> Self
The data text data and the names table names (whose names are
added to data by names_key), with no dialogue yet.
Sourcepub fn add_dialogue<D>(&mut self, dialogue: &DialogueTable<D>)
pub fn add_dialogue<D>(&mut self, dialogue: &DialogueTable<D>)
Adds every line, reply and caption of dialogue.
Trait Implementations§
Source§impl Clone for SourceText
impl Clone for SourceText
Source§fn clone(&self) -> SourceText
fn clone(&self) -> SourceText
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SourceText
impl Debug for SourceText
Source§impl Default for SourceText
impl Default for SourceText
Source§fn default() -> SourceText
fn default() -> SourceText
Returns the “default value” for a type. Read more
impl Eq for SourceText
Source§impl PartialEq for SourceText
impl PartialEq for SourceText
impl StructuralPartialEq for SourceText
Auto Trait Implementations§
impl Freeze for SourceText
impl RefUnwindSafe for SourceText
impl Send for SourceText
impl Sync for SourceText
impl Unpin for SourceText
impl UnsafeUnpin for SourceText
impl UnwindSafe for SourceText
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