taylor
Class BarnyardSimon.HandleGameButton

java.lang.Object
  extended by taylor.BarnyardSimon.HandleGameButton
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener
Enclosing class:
BarnyardSimon

private class BarnyardSimon.HandleGameButton
extends java.lang.Object
implements java.awt.event.ActionListener

This class listens solely for game play buttons to be pressed. Once pressed, this class determines which button was pressed and then advances game play appropriately.

Version:
FIX
Author:
FIX

Constructor Summary
BarnyardSimon.HandleGameButton()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          Handles an action event caused by one of the four colored buttons in Barnyard Simon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BarnyardSimon.HandleGameButton

private BarnyardSimon.HandleGameButton()
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Handles an action event caused by one of the four colored buttons in Barnyard Simon.

The method first determines if the correct button was pressed.

If not, the game has ended and the method must ensure that the high score is updated (if necessary) and resets the label on the start button and enables it.

If the correct button is pressed, then the button is activated and the current count of how many buttons in the sequence the player has pressed correctly must be incremented. If the player has pressed all of the buttons in the sequence correctly, the method must ensure that the sequence with one additional entry be played.

Specified by:
actionPerformed in interface java.awt.event.ActionListener