Blackjack

com.amoebacode.blackjack.display
Class BasicStrategyDisplay

java.lang.Object
  |
  +--com.amoebacode.blackjack.display.DisplayElement
        |
        +--com.amoebacode.blackjack.display.BasicStrategyDisplay
All Implemented Interfaces:
BasicStrategyEventListener, BlackjackEventListener, java.util.EventListener

public class BasicStrategyDisplay
extends DisplayElement
implements BasicStrategyEventListener

BasicStrategyDisplay handles the display of hints from the basic strategy tutor.

Version:
0.9
Author:
Jason Gurney

Field Summary
private  LabelWrapper firstStrategyLabel
          The first line of the strategy hint label
private static java.lang.String INSURANCE_FIRST_LINE
          The standard first line of the insurance hint
private static java.lang.String INSURANCE_SECOND_LINE
          The standard second line of the insurance hint
private  LabelWrapper secondStrategyLabel
          The second line of the strategy hint label
private static java.lang.String STANDARD_FIRST_LINE
          The standard first line of the strategy hint
private  IBasicStrategy strat
          The basic strategy tutor being displayed
 
Fields inherited from class com.amoebacode.blackjack.display.DisplayElement
parent
 
Constructor Summary
protected BasicStrategyDisplay(GameDisplay game)
          Method BasicStrategyDisplay.
 
Method Summary
 void buyingInsurance(BasicStrategyEvent event)
          Sets the text of the strategy hint labels to the standard insurance message.
 void hideStrategyLabels()
          Hides the strategy hint labels.
private  void incorrectMove()
          Plays the incorrect move sound clip and displays the strategy hint labels.
 void incorrectMove(BasicStrategyEvent event)
          Sets the text of the strategy hint labels according to the incorrect playing decision.
protected  void setBasicStrategy(IBasicStrategy strat)
          Sets the basic strategy tutor.
private  void setupLabels()
          Sets up the strategy hint labels.
private  void showStrategyLabels(boolean display)
          Displays or hides the strategy hint labels as specified by the boolean argument.
 
Methods inherited from class com.amoebacode.blackjack.display.DisplayElement
executeGameCommand, getDisplayManager, getGameDisplay, getParent, hasParent, playGameClip, queueAction, resumeQueue
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

STANDARD_FIRST_LINE

private static final java.lang.String STANDARD_FIRST_LINE
The standard first line of the strategy hint

INSURANCE_FIRST_LINE

private static final java.lang.String INSURANCE_FIRST_LINE
The standard first line of the insurance hint

INSURANCE_SECOND_LINE

private static final java.lang.String INSURANCE_SECOND_LINE
The standard second line of the insurance hint

firstStrategyLabel

private LabelWrapper firstStrategyLabel
The first line of the strategy hint label

secondStrategyLabel

private LabelWrapper secondStrategyLabel
The second line of the strategy hint label

strat

private IBasicStrategy strat
The basic strategy tutor being displayed
Constructor Detail

BasicStrategyDisplay

protected BasicStrategyDisplay(GameDisplay game)
Method BasicStrategyDisplay.
Parameters:
game - the parent GameDisplay
Method Detail

setBasicStrategy

protected void setBasicStrategy(IBasicStrategy strat)
Sets the basic strategy tutor.
Parameters:
strat - the IBasicStrategy being displayed

setupLabels

private void setupLabels()
Sets up the strategy hint labels.

buyingInsurance

public void buyingInsurance(BasicStrategyEvent event)
Description copied from interface: BasicStrategyEventListener
Sets the text of the strategy hint labels to the standard insurance message.
Specified by:
buyingInsurance in interface BasicStrategyEventListener
See Also:
BasicStrategyEventListener.buyingInsurance(BasicStrategyEvent)

incorrectMove

public void incorrectMove(BasicStrategyEvent event)
Description copied from interface: BasicStrategyEventListener
Sets the text of the strategy hint labels according to the incorrect playing decision.
Specified by:
incorrectMove in interface BasicStrategyEventListener
See Also:
BasicStrategyEventListener.incorrectMove(BasicStrategyEvent)

incorrectMove

private void incorrectMove()
Plays the incorrect move sound clip and displays the strategy hint labels.

hideStrategyLabels

public void hideStrategyLabels()
Hides the strategy hint labels.

showStrategyLabels

private void showStrategyLabels(boolean display)
Displays or hides the strategy hint labels as specified by the boolean argument.
Parameters:
display - the new visibility attribute of the strategy hint labels

Blackjack

Copyright © 2002 amoebacode.com.