package org.academiadecodigo.bootcamp11.rockpaperscissors;

/**
 * MIT License
 * (c) 2017 Ricardo Constantino
 */
public class Player {
    private String name;
    private int wins;

    public Player(String name) {
        this.name = name;
    }

    public String getName() {
        return this.name;
    }

    public int getWins() {
        return this.wins;
    }

    public void addWin() {
        this.wins++;
        System.out.println(this.name + " won this round!");
    }

    public Hand chooseHand(Flavor flavor) {
        int roll = (int) (Math.random() * flavor.getNumOfChoices());
        return Hand.values()[roll];
    }
}
