Sorry for this long post but I don't know how to explain it in a shorter form.
What container allows fast finding of a specific item -and- also allows scanning by using iterators that can be incremented in a "for" loop? My data:
Code:
Number of players: 4
BetInfo for each player:
---------------------------
Passline: betAmount, coordX, coordY
No Pass : betAmount, coordX, coordy
Field : betAmount, coordX, coordY
Place4 : betAmount, coordX, coordY
Place5 : betAmount, coordX, coordY
--- continues for about 50 different bets ---
QUESTION 1:
When dice is rolled, the diceSum dictates which bet amount I need to access. For instance, if the diceSum is a 2 on the first roll, the Passline bet loses for all 4 players so I need to access the Passline betAmount for each player to see of a bet was made (betAmount > 0). Then handle it.
(Player1 > Passline > betAmount), then
(Player2 > Passline > betAmount), then
(Player3 > Passline > betAmount), then
(Player4 > Passline > betAmount)
Which container will provide fast access to the betAmount for each player? Note that I have to do also do this for other bets like NoPass bets, Field bets, oneRoll2 bets, anyCrap bets, Horn bets and World bets to pay each player.
----------
QUESTION 2:
When a shooter 7's out, I need to pay some bets then zero all bets on the table for all 4 players. When I zero all bets on the table for 4 players, I would like to do it using iterators like in a "for" loop. So the container needs to be able to do this also. Which container can do #1 above and #2?
----------
Hope my explanation is clear enough. I think I need to use a 3 dimensional array to hold all of the BetInfo.
50 rows will be for each bet. (approximate)
3 columns will be for betAmount, coordX, coordY.
4 layers will be for the 4 players.
Bookmarks