Struct texture::state::BasicState [] [src]

pub struct BasicState { /* fields omitted */ }

Basic state structure

Includes hashmaps for frequently used types

It is recommended to build a custom state type rather than using this basic one.

Trait Implementations

impl BaseState for BasicState
[src]

Examples

use texture::state::BaseState;
use texture::state::BasicState;

let mut state = BasicState::new();

Simply removes all keys from the internal hashmaps

Examples

use texture::state::BaseState;
use texture::state::BasicState;

let mut state = BasicState::new();

// Do operations over state...

// Clear state
state.clear();

Examples

use texture::state::BaseState;
use texture::state::BasicState;

let mut state = BasicState::new();

// Set flag
state.set_flag("in_start".to_string(), true);

assert_eq!(state.get_flag("in_start".to_string()), true);

Examples

use texture::state::BaseState;
use texture::state::BasicState;

let mut state = BasicState::new();

// Set flag
state.set_flag("in_start".to_string(), true);
assert_eq!(state.get_flag("in_start".to_string()), true);

state.set_flag("in_start".to_string(), false);
assert_eq!(state.get_flag("in_start".to_string()), false);

Examples

use texture::state::BaseState;
use texture::state::BasicState;

let mut state = BasicState::new();

// Set flag
state.set_value("time".to_string(), 850);
assert_eq!(state.get_value("time".to_string()), 850);

Examples

use texture::state::BaseState;
use texture::state::BasicState;

let mut state = BasicState::new();

// Set flag
state.set_value("time".to_string(), 850);
assert_eq!(state.get_value("time".to_string()), 850);

state.set_value("time".to_string(), 700);
assert_eq!(state.get_value("time".to_string()), 700);