Struct cyoa::State [−][src]
pub struct State { pub config: Game, // some fields omitted }
Expand description
The “State” of the game, including config, current path, and history
Fields
config: Game
Implementations
impl State
[src]
impl State
[src]pub fn jump(&mut self, path: usize)
[src]
pub fn jump(&mut self, path: usize)
[src]Sets the game state and history to something else based on user interaction
pub fn get_path_id(&self) -> usize
[src]
pub fn get_path_id(&self) -> usize
[src]Gets the current position (page number)
pub fn export_save(&self) -> String
[src]
pub fn export_save(&self) -> String
[src]Exports the save to a string so others can load and replay (WIP)
pub fn import_save(&mut self, save: &String)
[src]
pub fn import_save(&mut self, save: &String)
[src]Imports a string to the State to load a history
Trait Implementations
impl<'de> Deserialize<'de> for State
[src]
impl<'de> Deserialize<'de> for State
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,