edu.ucla.stat.SOCR.games
Class MontyHallGame

java.lang.Object
  extended by edu.ucla.stat.SOCR.core.SOCRValueSettable
      extended by edu.ucla.stat.SOCR.core.MultiplePartsPanel
          extended by edu.ucla.stat.SOCR.core.Game
              extended by edu.ucla.stat.SOCR.games.MontyHallGame
All Implemented Interfaces:
IGame, IValueSettable, Pluginable, java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, java.util.Observer

public class MontyHallGame
extends Game
implements java.awt.event.ItemListener

This class models the famous Monty Hall game. A diamond is behind one door, jockers are behind the other two. The player first chooses a door. Then the host opens a different door. The player can stay with her original choice or switch to the remaining door.


Nested Class Summary
 
Nested classes/interfaces inherited from class edu.ucla.stat.SOCR.core.MultiplePartsPanel
MultiplePartsPanel.SOCRToolBar
 
Field Summary
static int BLIND
           
static int STANDARD
           
 
Fields inherited from class edu.ucla.stat.SOCR.core.MultiplePartsPanel
applet, fName, graphs, mainPane, recordTable, tables, toolbar, toolbar2, toolbars
 
Constructor Summary
MontyHallGame()
          This method initializes the game, including the toolbar buttons, doors, images
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          This method handles the events for the Play button
 void itemStateChanged(java.awt.event.ItemEvent event)
          This method handles the events for the host choice
 void mouseClicked(java.awt.event.MouseEvent event)
          This method handles events for the door clicks
 void reset()
          This message resets the game
 
Methods inherited from class edu.ucla.stat.SOCR.core.Game
getAppletInfo, getDisplayPane, getInstance, getOnlineDescription, performAction, setAppletInfo, updateGame
 
Methods inherited from class edu.ucla.stat.SOCR.core.MultiplePartsPanel
addGraph, addTable, addTool, addTool2, addToolbar, format, getMainPanel, getName, getRecordTable, getTextPanel, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, play, removeToolbar, setApplet, setName, update
 
Methods inherited from class edu.ucla.stat.SOCR.core.SOCRValueSettable
createComponentSetter, createValueSetter, createValueSetter, createValueSetter, createValueSetter, getComponentSetter, getComponentSetters, getValueSetter, getValueSetters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.ucla.stat.SOCR.core.Pluginable
getName, setApplet
 

Field Detail

STANDARD

public static final int STANDARD
See Also:
Constant Field Values

BLIND

public static final int BLIND
See Also:
Constant Field Values
Constructor Detail

MontyHallGame

public MontyHallGame()
This method initializes the game, including the toolbar buttons, doors, images

Method Detail

reset

public void reset()
This message resets the game

Specified by:
reset in interface IGame
Overrides:
reset in class Game

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
This method handles the events for the Play button

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class Game

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent event)
This method handles the events for the host choice

Specified by:
itemStateChanged in interface java.awt.event.ItemListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent event)
This method handles events for the door clicks

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Overrides:
mouseClicked in class MultiplePartsPanel