Module onejoker::cards::suit

source ·
Expand description

wiki | A simple numeric enum for card suits.

§Examples

use onejoker::cards::Suit;
let s = Suit::Diamond;
println!("{}, {}, {}, {}", s.name(), s.to_char(),
    s.to_symbol(), Suit::from_char('d').unwrap());

Enums§

  • wiki | Simple integer enum. Specific numbers do matter: I do a lot of math with them to optimize things, and the same numbers are used in the other languages in the project.