Blackjack

com.amoebacode.blackjack.display
Class DisplayPreferences

java.lang.Object
  |
  +--com.amoebacode.blackjack.display.DisplayPreferences

class DisplayPreferences
extends java.lang.Object

DisplayPreferences tracks user display preferences.

Version:
0.9
Author:
Jason Gurney

Field Summary
private  int animationDelay
          The current animation delay
private static int FAST_ANIMATION_DELAY
          The millisecond delay for fast animation
private static int PIXELS_PER_MOVE
          The number of pixels to move per animation loop
private  boolean playAudio
          Indicates whether audio clips should be played
private static int SLOW_ANIMATION_DELAY
          The millisecond delay for slow animation
 
Constructor Summary
protected DisplayPreferences()
          Default protected constructor
 
Method Summary
protected  int getAnimationDelay()
          Returns the current animation delay
protected static int getPixelsPerMove()
          Returns the number of pixels to move per animation loop.
protected  boolean isFastAnimationDelay()
          Indicates whether the current animation delay is fast.
protected  boolean isPlayAudio()
          Indicates whether sound clips should be played.
protected  boolean isSlowAnimationDelay()
          Indicates whether the current animation delay is slow.
protected  void setFastAnimation()
          Sets the animation delay to fast animation.
protected  void setPlayAudio(boolean playAudio)
          Turns the audio on or off.
protected  void setSlowAnimation()
          Sets the animation delay to slow animation.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

SLOW_ANIMATION_DELAY

private static final int SLOW_ANIMATION_DELAY
The millisecond delay for slow animation

FAST_ANIMATION_DELAY

private static final int FAST_ANIMATION_DELAY
The millisecond delay for fast animation

animationDelay

private int animationDelay
The current animation delay

PIXELS_PER_MOVE

private static final int PIXELS_PER_MOVE
The number of pixels to move per animation loop

playAudio

private boolean playAudio
Indicates whether audio clips should be played
Constructor Detail

DisplayPreferences

protected DisplayPreferences()
Default protected constructor
Method Detail

getAnimationDelay

protected int getAnimationDelay()
Returns the current animation delay
Returns:
the millisecond animation delay

setSlowAnimation

protected void setSlowAnimation()
Sets the animation delay to slow animation.

setFastAnimation

protected void setFastAnimation()
Sets the animation delay to fast animation.

isPlayAudio

protected boolean isPlayAudio()
Indicates whether sound clips should be played.
Returns:
true if audio is on

setPlayAudio

protected void setPlayAudio(boolean playAudio)
Turns the audio on or off.
Parameters:
strategyTutor - the new audio setting

isSlowAnimationDelay

protected boolean isSlowAnimationDelay()
Indicates whether the current animation delay is slow.
Returns:
true if using slow animation

isFastAnimationDelay

protected boolean isFastAnimationDelay()
Indicates whether the current animation delay is fast.
Returns:
true if using fast animation

getPixelsPerMove

protected static int getPixelsPerMove()
Returns the number of pixels to move per animation loop.
Returns:
the number of pixels per move

Blackjack

Copyright © 2002 amoebacode.com.