Struct elma::state::State[][src]

pub struct State {
    pub version: u32,
    pub times: Vec<BestTimes>,
    pub players: Vec<PlayerEntry>,
    pub player_a_name: String,
    pub player_b_name: String,
    pub player_a_keys: PlayerKeys,
    pub player_b_keys: PlayerKeys,
    pub sound_enabled: bool,
    pub sound_optimization: SoundOptimization,
    pub play_mode: PlayMode,
    pub flagtag: bool,
    pub swap_bikes: bool,
    pub video_detail: VideoDetail,
    pub animated_objects: bool,
    pub animated_menus: bool,
    pub inc_screen_size_key: u32,
    pub dec_screen_size_key: u32,
    pub screenshot_key: u32,
    pub last_edited_lev_name: String,
    pub last_played_external: String,
}

State.dat struct

Fields

State file version; the only supported value is 200.

Best times lists. state.dat has a fixed-size array of 90 of these.

List of players. state.dat has a fixed-size array of 50 of these.

Name of player A, maximum 14 characters.

Name of player B, maximum 14 characters.

Keys for player A.

Keys for player B.

Whether sound is enabled.

Sound optimization.

Play mode.

Whether flag tag mode is enabled.

Whether bikes are swapped.

Video detail.

Whether objects are animated.

Whether menus are animated.

Key for increasing screen size.

Key for decreasing screen size.

Key for taking a screenshot.

Name of last edited level.

Name of last played external level.

Methods

impl State
[src]

Create a new state.dat.

Load a state.dat file.

Examples

let state = State::load("state.dat").unwrap();

Load a state.dat file from bytes.

Examples

let state = State::from_bytes(&[0,1,2]).unwrap();

Returns state.dat as a stream of bytes.

Examples

let mut state = State::load("state.dat").unwrap();
let buffer = state.to_bytes().unwrap();

Save state.dat

Examples

let mut state = State::load("state.dat").unwrap();
state.save("newstate.dat").unwrap();

Trait Implementations

impl Default for State
[src]

Returns the "default value" for a type. Read more

impl Debug for State
[src]

Formats the value using the given formatter. Read more

impl Clone for State
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for State
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

impl Send for State

impl Sync for State