buckshot_roulette_gameplay_engine/
player_number.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use std::fmt::Display;

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum PlayerNumber {
    One = 1,
    Two = 2,
    Three = 3,
    Four = 4,
}

impl Display for PlayerNumber {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let str = match self {
            PlayerNumber::One => "One",
            PlayerNumber::Two => "Two",
            PlayerNumber::Three => "Three",
            PlayerNumber::Four => "Four",
        };

        write!(f, "{}", str)
    }
}