use rand::prelude::*;

fn main() {
    println!("Beginning game of Pig...");

    let mut players = vec![
        Player::new(String::from("PLAYER (1) ONE")),
        Player::new(String::from("PLAYER (2) TWO")),
    ];

    'game: loop {
        for player in players.iter_mut() {
            if player.cont() {
                println!("\n# {} has {:?} Score", player.name, player.score);
                player.resolve();
            } else {
                println!("\n{} wins!", player.name);
                break 'game;
            }
        }
    }

    println!("Thanks for playing!");
}

type DiceRoll = u32;
type Score = u32;
type Name = String;

enum Action {
    Roll,
    Hold,
}

#[derive(PartialEq)]
enum TurnStatus {
    Continue,
    End,
}

struct Player {
    name: Name,
    score: Score,
    status: TurnStatus,
}

impl Player {
    fn new(name: Name) -> Player {
        Player {
            name,
            score: 0,
            status: TurnStatus::Continue,
        }
    }

    fn roll() -> DiceRoll {