Crate heartless

Source
Expand description

The heartless game library.

This is a game similar with mshearts but running in console.

See README.md for the rule of the game, the commandline interface and the input.

If the library users want to run this game in the background, and doing interaction with the player in another UI frontend, just enables the altio feature.

§Example

[dependencies]
heartless = { version = "0.1", features = ["altio"] }
#[cfg( feature="altio" )] {
    let config = heartless::cli::Config::from_args( std::env::args_os() );
    let mut game = heartless::Game::with_config( config );
    let game_io = game.altio.clone();
    std::thread::spawn( move || game.main_loop() );
    // use `game_io.send_line()`/`game_io.recv()` to communicate with `game`.
    // See https://docs.rs/altio for more.
}

Re-exports§

pub use card::*;
pub use game::*;
pub use player::*;

Modules§

card
Cards definition of storing, comparing, passing, discarding, printing.
cli
Commandline interface and program configuration.
game
Implementation of game logic: input, output, rule checker, AI strategies.
player
Players related definitions.