Class LottoLogic

java.lang.Object
  |
  +--LottoLogic

public class LottoLogic
extends java.lang.Object

Logic for the Lotto game.


Constructor Summary
LottoLogic(LottoGUI gui)
          Construct a LottoLogic object connected to the specified LottoGUI object.
 
Method Summary
 void buttonPressed(int button)
          Updates the logic when a numbered button is pressed.
 void clearTheBoard()
          Prepare the logic for another draw.
 void draw()
          "Play" the Lotto game once.
 void reset()
          Clears the board and resets the statistics back to zero.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LottoLogic

public LottoLogic(LottoGUI gui)
Construct a LottoLogic object connected to the specified LottoGUI object.

Parameters:
gui - the GUI "connected" to the user.
Method Detail

draw

public void draw()
"Play" the Lotto game once. Draws MAX_SELECT balls from a BallBox and updates the GUI.


reset

public void reset()
Clears the board and resets the statistics back to zero. Note that this method does not "unselect" the numbers the player has selected.


buttonPressed

public void buttonPressed(int button)
Updates the logic when a numbered button is pressed.

Parameters:
button - the number of the button pressed.

clearTheBoard

public void clearTheBoard()
Prepare the logic for another draw. Resets the unselected buttons back to their original state. The selected buttons are changed back to the "selected" color.