Created
April 27, 2013 13:48
-
-
Save anonymous/5473188 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Roulette; | |
import java.util.Iterator; | |
import java.util.LinkedList; | |
import java.util.ListIterator; | |
public class Table { | |
public int limit = 1000; | |
public LinkedList<Bet> bets; | |
public Table(){ | |
bets = new LinkedList<Bet>(); | |
} | |
public boolean isValid(Bet bet){ | |
int sum = 0; | |
for(Bet bett: bets){ | |
sum += bett.amountBet; | |
} | |
return (sum>limit); | |
} | |
public void placeBet(Bet bet){ | |
bets.add(bet); | |
} | |
ListIterator<Bet> iterator(){ | |
return bets.listIterator(); | |
} | |
// public String toString(){ | |
// | |
// for( ListIterator<Bet> i = iterator(); i.hasNext(); ) { | |
// Bet bet = i.next(); | |
// if( oc.name.contains(name) ) {result.add( oc );} | |
// } | |
// | |
// } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment