Struct ayaka_runtime::Context
source · pub struct Context { /* private fields */ }Expand description
The game running context.
Implementations§
source§impl Context
impl Context
sourcepub fn open<'a>(
paths: &'a [impl AsRef<Path>],
frontend: FrontendType
) -> impl Future<Output = Result<Self>> + Stream<Item = OpenStatus> + 'a
pub fn open<'a>( paths: &'a [impl AsRef<Path>], frontend: FrontendType ) -> impl Future<Output = Result<Self>> + Stream<Item = OpenStatus> + 'a
Open a config file with frontend type.
If the input paths contains only one element, it may be a YAML or an FRFS file.
If the input paths contains many element, they should all be FRFS files,
and the latter one will override the former one.
sourcepub fn set_start_context(&mut self)
pub fn set_start_context(&mut self)
Initialize the RawContext at the start of the game.
sourcepub fn set_context(&mut self, ctx: RawContext)
pub fn set_context(&mut self, ctx: RawContext)
Initialize the RawContext with given record.
sourcepub fn get_action(&self, loc: &Locale, ctx: &RawContext) -> Result<Action>
pub fn get_action(&self, loc: &Locale, ctx: &RawContext) -> Result<Action>
Get the Action from [Locale] and RawContext.
sourcepub fn next_run(&mut self) -> Option<RawContext>
pub fn next_run(&mut self) -> Option<RawContext>
Step to next line.
sourcepub fn current_paragraph_title(&self, loc: &Locale) -> Option<&String>
pub fn current_paragraph_title(&self, loc: &Locale) -> Option<&String>
Get current paragraph title.
Auto Trait Implementations§
impl !RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
Blanket Implementations§
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.