pub trait SceneRules<D> {
// Required methods
fn limits(&self) -> &DialogueLimits;
fn tokens(&self) -> &dyn Tokens;
// Provided methods
fn widths(&self) -> &CellWidths { ... }
fn names(&self) -> Option<&Names> { ... }
fn can_speak(&self, _character: &CharacterId) -> bool { ... }
fn expression_problem(
&self,
_character: &CharacterId,
_expression: &str,
) -> Option<String> { ... }
fn speech_problem(
&self,
_speaker: &CharacterId,
_cells: usize,
) -> Option<String> { ... }
fn music_problem(&self, _cue: &str) -> Option<String> { ... }
fn scene_problems(&self, _parsed: &ParsedScene<D>) -> Vec<ContentError> { ... }
}Expand description
What check_scene checks a scene against: the game’s limits, tokens
and names, and whatever it knows of its characters, portraits and
music. A check the game has nothing for passes.
Required Methods§
Sourcefn limits(&self) -> &DialogueLimits
fn limits(&self) -> &DialogueLimits
How much text the box and the menu hold.
Provided Methods§
Sourcefn widths(&self) -> &CellWidths
fn widths(&self) -> &CellWidths
How many cells each character takes, which the limits count: the
font atlas’s (CellWidths::of). One cell for every character,
the default, when the game doesn’t say.
Sourcefn names(&self) -> Option<&Names>
fn names(&self) -> Option<&Names>
The names table, when it loaded: name tokens and names written out are checked against it, and every name token counts as its longest name.
Sourcefn can_speak(&self, _character: &CharacterId) -> bool
fn can_speak(&self, _character: &CharacterId) -> bool
Whether character may be placed and speak.
Sourcefn expression_problem(
&self,
_character: &CharacterId,
_expression: &str,
) -> Option<String>
fn expression_problem( &self, _character: &CharacterId, _expression: &str, ) -> Option<String>
What is wrong with character showing expression, if anything.
Sourcefn speech_problem(
&self,
_speaker: &CharacterId,
_cells: usize,
) -> Option<String>
fn speech_problem( &self, _speaker: &CharacterId, _cells: usize, ) -> Option<String>
What is wrong with speaker saying a line of cells cells (at
most, tokens filled in), if anything, beyond the box’s limit.
Sourcefn music_problem(&self, _cue: &str) -> Option<String>
fn music_problem(&self, _cue: &str) -> Option<String>
What is wrong with @music <cue>, if anything.
Sourcefn scene_problems(&self, _parsed: &ParsedScene<D>) -> Vec<ContentError>
fn scene_problems(&self, _parsed: &ParsedScene<D>) -> Vec<ContentError>
The game’s own checks on parsed, which
scripts_from_sources runs after
check_scene.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".