Struct curses_game_wrapper::GameSetting [] [src]

pub struct GameSetting<'a> { /* fields omitted */ }

Game process builder, providing control over how a new process should be spawned.

Like std::process::Command, A default configuration can be generated using Gamesetting::new(command name) and other settings can be added by builder methods.

Example

extern crate curses_game_wrapper as cgw;
use cgw::{Reactor, ActionResult, AsciiChar, GameSetting, Severity};
use std::time::Duration;
fn main() {
    let loopnum = 50;
    let gs = GameSetting::new("rogue")
        .env("ROGUEUSER", "EmptyAI")
        .lines(24)
        .columns(80)
        .debug_file("debug.txt")
        .max_loop(loopnum + 1)
        .draw_on(Duration::from_millis(200));
    let game = gs.build();
}

Methods

impl<'a> GameSetting<'a>
[src]

[src]

Build GameSetting object with command name(like rogue).

[src]

Set screen width of curses widow

[src]

Set screen height of curses window

[src]

Add command line argument

[src]

Set environmental variable

[src]

Set multiple command line arguments

[src]

Set multiple environmental variables

[src]

Draw game on terminal(Default: off). You hanve to set duration of drawing.

[src]

You can set debug file of this crate. This is mainly for developper of this crate:)

[src]

You can set debug level of this crate. This is mainly for developper of this crate:)

[src]

You can set timeout to game output. It's setted to 0.1s by default.

[src]

You can set max_loop of game. It's setted to 100 by default.

[src]

Consume game setting and build GameEnv

Trait Implementations

impl<'a> Clone for GameSetting<'a>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'a> Debug for GameSetting<'a>
[src]

[src]

Formats the value using the given formatter.