Struct ayaka_runtime::Game
source · pub struct Game {
pub config: GameConfig,
pub paras: HashMap<Locale, HashMap<String, Vec<Paragraph>>>,
pub res: HashMap<Locale, VarMap>,
}Expand description
The full Ayaka game. It consists of global config and all paragraphs.
Fields§
§config: GameConfigThe game config.
paras: HashMap<Locale, HashMap<String, Vec<Paragraph>>>The paragraphs, indexed by locale. The inner is the paragraphs indexed by file names.
res: HashMap<Locale, VarMap>The resources, indexed by locale.
Implementations§
source§impl Game
impl Game
sourcepub fn start_context(&self) -> RawContext
pub fn start_context(&self) -> RawContext
Create a RawContext at the start of the game.
sourcepub fn find_para(
&self,
loc: &Locale,
base_tag: &str,
tag: &str
) -> Option<&Paragraph>
pub fn find_para( &self, loc: &Locale, base_tag: &str, tag: &str ) -> Option<&Paragraph>
Find a paragraph by tag, with specified locale.
sourcepub fn find_para_fallback(
&self,
loc: &Locale,
base_tag: &str,
tag: &str
) -> Fallback<&Paragraph>
pub fn find_para_fallback( &self, loc: &Locale, base_tag: &str, tag: &str ) -> Fallback<&Paragraph>
Find a paragraph by tag, with specified locale.
sourcepub fn find_res_fallback(&self, loc: &Locale) -> Fallback<&VarMap>
pub fn find_res_fallback(&self, loc: &Locale) -> Fallback<&VarMap>
Find the resource map with specified locale.
Auto Trait Implementations§
impl RefUnwindSafe for Game
impl Send for Game
impl Sync for Game
impl Unpin for Game
impl UnwindSafe for Game
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