package model;

import java.util.List;
import java.util.Random;

public class Player {

	public final String id;
	private int chopsticks;
	private final String color;
	private List<Bet> betHistory;

	public Player(String id, String color) {
		super();
		this.id = id;
		this.color = color;
		this.chopsticks = 3;
	}

	public Bet bet(List<Bet> unavailableBets, int sumOfAvailableChopsticks, List<Round> roundHistory ) {
		BetAdvisor.calculateBetterBet(this, unavailableBets, sumOfAvailableChopsticks, roundHistory);
		Bet bet;
		do {
			bet = new Bet(this, sumOfAvailableChopsticks);
		} while (unavailableBets.contains(bet));
		betHistory.add(bet);
		return bet;
	}

	public Hold hold() {
		return new Hold(this, new Random().nextInt(chopsticks));
	}

	public void discardChopstick() {
		--chopsticks;
	}

	public String getColor() {
		return color;
	}

	public String getId() {
		return id;
	}

	public int getChopsticks() {
		return chopsticks;
	}
	
	public Bet getLastBet() {
		return betHistory.get(betHistory.size() -1);
	}

}

@@ -9,16 +9,44 @@
 model;%0A%0A
+import java.util.ArrayList;%0A
 import j
@@ -334,16 +334,58 @@
 ks = 3;%0A
+%09%09this.betHistory = new ArrayList%3CBet%3E();%0A
 %09%7D%0A%0A%09pub
@@ -477,17 +477,16 @@
 dHistory
- 
 ) %7B%0A%09%09Be
@@ -1012,17 +1012,16 @@
 cks;%0A%09%7D%0A
-%09
 %0A%09public
@@ -1083,16 +1083,17 @@
 size() -
+ 
 1);%0A%09%7D%0A%0A

Add minor fix betHistory::new