pub struct BasicData<A: ActionSet, T: Debug + 'static = ()> {
pub font: FontAtlasDef,
pub images: ImageTable,
pub bundle: Bundle,
pub own: T,
/* private fields */
}Expand description
A game’s data on the short path: what the engine reads from the
standard files, the files themselves and the game’s own part T. Its
actions are A (most simply UiAction), its colours the engine’s.
Fields§
§font: FontAtlasDefThe font atlas.
images: ImageTableEvery picture of the bundle but the font’s.
bundle: BundleThe bundle the data was read from: the pictures’ bytes.
own: TThe game’s own part.
Implementations§
Source§impl<A: ActionSet, T: Debug + 'static> BasicData<A, T>
impl<A: ActionSet, T: Debug + 'static> BasicData<A, T>
Sourcepub fn formats() -> Formats
pub fn formats() -> Formats
The formats it reads with: the engine’s standard ones, the palette
with the engine’s colours and the font atlas with
BASIC_GLYPHS in their place, the keymap of A and the English.
Sourcepub fn load(
bundle: Bundle,
console: ConsoleSpec,
own: Own<T>,
) -> Result<Self, Vec<ContentError>>
pub fn load( bundle: Bundle, console: ConsoleSpec, own: Own<T>, ) -> Result<Self, Vec<ContentError>>
The data in bundle, on console, with the game’s own part read
by own; or every problem of every file at once, each naming its
file.
Trait Implementations§
Source§impl<A: ActionSet, T: Debug + 'static> GameData for BasicData<A, T>
impl<A: ActionSet, T: Debug + 'static> GameData for BasicData<A, T>
Source§type Colors = EngineColor
type Colors = EngineColor
The colors the game’s code draws with.
Source§fn keymap_def(&self) -> &KeymapDef<A>
fn keymap_def(&self) -> &KeymapDef<A>
The keymap file: every layout’s default keys, the layout picker’s
and the controller buttons.
Source§fn audio_manifest(&self) -> &AudioManifest
fn audio_manifest(&self) -> &AudioManifest
The sound and music cues.
Source§fn palette_def(&self) -> &PaletteDef
fn palette_def(&self) -> &PaletteDef
The palette the game starts with, before the settings are read.
Source§fn console(&self) -> ConsoleSpec
fn console(&self) -> ConsoleSpec
The console the game starts on (
Ctx::console).Source§fn theme_def(
&self,
theme: <Self::Settings as GameSettings>::Theme,
) -> Option<&PaletteDef>
fn theme_def( &self, theme: <Self::Settings as GameSettings>::Theme, ) -> Option<&PaletteDef>
The palette of a color
theme; None keeps the palette there is.
By default the game has one palette: always None.Source§fn audio_config(&self) -> AudioConfig
fn audio_config(&self) -> AudioConfig
Which of the game’s sound cues the engine’s widgets and screens
play for a menu’s moves and choices and a cursor’s steps: by
default the cues named after what they are
(
AudioConfig::DEFAULT).Source§fn debug_lang(&self) -> Option<&str>
fn debug_lang(&self) -> Option<&str>
The language only a build with debug tools shows (a test pack), if
the game has one: without debug tools it is English.
Source§fn key_text(
&self,
name: &str,
keys: HelpKeys<'_, Self::Action>,
) -> Option<String>
fn key_text( &self, name: &str, keys: HelpKeys<'_, Self::Action>, ) -> Option<String>
The text of a
{name} placeholder that names a key
(Ctx::text_with): by default the cursor keys for {Cursor} and
the key of the action called name (text::key_text); None
leaves it as written.Source§fn voice_variant(&self) -> Self::Voice
fn voice_variant(&self) -> Self::Voice
Which clip of a line plays now, where a line has several (who the
player made the hero, say). By default the variant’s default: a
line’s only clip.
Source§fn voices(&self, _manifest: &str) -> Result<Playable<Self::Voice>, String>
fn voices(&self, _manifest: &str) -> Result<Playable<Self::Voice>, String>
The clips that may be played, from the text of the voice manifest
the platform read: those whose line still says what they say.
Err
says why the manifest can’t be used. By default the game has no
voices, and a manifest is refused.Source§fn apply_settings(
&mut self,
_now: &Settings<Self::Settings>,
_before: Option<&Settings<Self::Settings>>,
)
fn apply_settings( &mut self, _now: &Settings<Self::Settings>, _before: Option<&Settings<Self::Settings>>, )
Takes what the settings say that the game draws with (a map’s look,
say):
before is what they were (None when they were just
loaded). The engine applies the theme itself.Source§fn blank_cell(&self, palette: &Palette) -> Cell
fn blank_cell(&self, palette: &Palette) -> Cell
The cell the frame is cleared to before the screens draw: by
default a blank in the engine’s text color on its panel color.
Source§fn keys_before_profiles(&self) -> Vec<String>
fn keys_before_profiles(&self) -> Vec<String>
The
Storage keys the game kept a player’s data under before it
had profiles: a first launch with profiles moves them into the
first one (profiles::migrate). None by default.Auto Trait Implementations§
impl<A, T> Freeze for BasicData<A, T>where
T: Freeze,
impl<A, T> RefUnwindSafe for BasicData<A, T>where
T: RefUnwindSafe,
A: RefUnwindSafe,
impl<A, T> Send for BasicData<A, T>
impl<A, T> Sync for BasicData<A, T>
impl<A, T> Unpin for BasicData<A, T>where
T: Unpin,
impl<A, T> UnsafeUnpin for BasicData<A, T>where
T: UnsafeUnpin,
impl<A, T> UnwindSafe for BasicData<A, T>where
T: UnwindSafe,
A: RefUnwindSafe,
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