Class Bet
java.lang.Object
|
+--Bet
- public class Bet
- extends java.lang.Object
This class contains all the information on a particular bet. This
class holds information about what spot on the roulette table the
bet was placed on, and what amount of wager was placed on that
position.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Chris Juffre
|
Field Summary |
int |
Position
The position on the table the bet was made. |
int |
Wager
The dollar amount wagered on the position. |
|
Constructor Summary |
Bet(int Position,
int Wager)
Bet Constructor - Creates a Bet object given the position on the board and the wager. |
|
Method Summary |
private java.awt.Point |
getPointOfPosition(Roulette app)
This function returns the point representing the center of a betting rectangle. |
void |
paintChipOnBoard(java.awt.Graphics g,
Roulette app)
This function paints a "betting chip" on the board in the position
where that bet is placed with the wager written in the middle of the
chip. |
java.lang.String |
printResult()
This function prints bets in the form they need to be displayed
when printing the report of wins and loses. |
java.lang.String |
printWager()
This function prints the bet in string form to be placed in the
current bets TextArea display. |
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
Position
public int Position
- The position on the table the bet was made. For a list of
positions see RouletteConstants.
- Since:
- 1.0
Wager
public int Wager
- The dollar amount wagered on the position.
- Since:
- 1.0
Bet
public Bet(int Position,
int Wager)
- Bet Constructor - Creates a Bet object given the position on the board and the wager.
- Parameters:
Position - Position index on the board where the bet was placed.Wager - The amount of money in dollars wagered on the roulette index position.- Since:
- 1.0
printWager
public java.lang.String printWager()
- This function prints the bet in string form to be placed in the
current bets TextArea display.
- Returns:
- String to be added to the current bets text area
- Since:
- 1.0
printResult
public java.lang.String printResult()
- This function prints bets in the form they need to be displayed
when printing the report of wins and loses.
- Returns:
- String to be added to the report of winning or losing bets
- Since:
- 1.0
paintChipOnBoard
public void paintChipOnBoard(java.awt.Graphics g,
Roulette app)
- This function paints a "betting chip" on the board in the position
where that bet is placed with the wager written in the middle of the
chip.
- Parameters:
g - Graphics context of the applet.app - The main applet context.- Since:
- 1.0
getPointOfPosition
private java.awt.Point getPointOfPosition(Roulette app)
- This function returns the point representing the center of a betting rectangle.
- Parameters:
app - The Roulette applet to being drawn on containing margin data- Returns:
- The center point of the betting square
- Since:
- 1.0