mhframework.media
Class MHPlayingCard

java.lang.Object
  extended by mhframework.MHActor
      extended by mhframework.media.MHPlayingCard
All Implemented Interfaces:
MHRenderable

public class MHPlayingCard
extends MHActor


Field Summary
static int ACE
           
static int CARD_BACK
           
static int DEUCE
           
static int EIGHT
           
static int FIVE
           
static int FOUR
           
static int JACK
           
static int KING
           
static int NINE
           
static int QUEEN
           
static int SEVEN
           
static int SIX
           
static int SUIT_CLUBS
           
static int SUIT_DIAMONDS
           
static int SUIT_HEARTS
           
static int SUIT_SPADES
           
static int TEN
           
static int THREE
           
 
Constructor Summary
MHPlayingCard(int cardNumber)
           
MHPlayingCard(int cardFace, int cardSuit)
           
 
Method Summary
 boolean equals(int otherCardNumber)
           
 boolean equals(int otherCardFace, int otherCardSuit)
           
 boolean equals(MHPlayingCard otherCard)
           
 int getCardNumber()
          Return the unique identifier for this card.
 int getFace()
          Return an integer indicating the face of this card.
 java.awt.Image getImage()
          Returns current animation frame.
 MHImageGroup getImageGroup()
           
 int getSuit()
          Return an integer indicating the suit of this card.
 boolean isFaceDown()
           
 void render(java.awt.Graphics2D g)
          Draws the actor onto the sent graphics object based on its current action, animation frame number, and (x, y) coordinates
 void setFaceDown(boolean isFaceDown)
           
 java.lang.String toString()
          Returns a string representation of this card.
 
Methods inherited from class mhframework.MHActor
advance, getAnimationSequenceNumber, getBounds, getCenterX, getCenterY, getFrameCount, getFrameNumber, getFrameTimer, getHealth, getHeight, getHorizontalSpeed, getMaxHealth, getRotation, getRotationSpeed, getScale, getScaledBounds, getSpeed, getVerticalSpeed, getWidth, getX, getY, isAnimationFinished, render, setAnimationSequence, setFrameNumber, setFrameTimer, setHealth, setHorizontalSpeed, setImageGroup, setLocation, setMaxHealth, setRotation, setRotationSpeed, setScale, setSpeed, setVerticalSpeed, setX, setY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ACE

public static final int ACE
See Also:
Constant Field Values

DEUCE

public static final int DEUCE
See Also:
Constant Field Values

THREE

public static final int THREE
See Also:
Constant Field Values

FOUR

public static final int FOUR
See Also:
Constant Field Values

FIVE

public static final int FIVE
See Also:
Constant Field Values

SIX

public static final int SIX
See Also:
Constant Field Values

SEVEN

public static final int SEVEN
See Also:
Constant Field Values

EIGHT

public static final int EIGHT
See Also:
Constant Field Values

NINE

public static final int NINE
See Also:
Constant Field Values

TEN

public static final int TEN
See Also:
Constant Field Values

JACK

public static final int JACK
See Also:
Constant Field Values

QUEEN

public static final int QUEEN
See Also:
Constant Field Values

KING

public static final int KING
See Also:
Constant Field Values

SUIT_SPADES

public static final int SUIT_SPADES
See Also:
Constant Field Values

SUIT_DIAMONDS

public static final int SUIT_DIAMONDS
See Also:
Constant Field Values

SUIT_CLUBS

public static final int SUIT_CLUBS
See Also:
Constant Field Values

SUIT_HEARTS

public static final int SUIT_HEARTS
See Also:
Constant Field Values

CARD_BACK

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

MHPlayingCard

public MHPlayingCard(int cardFace,
                     int cardSuit)
Parameters:
cardFace -
cardSuit -

MHPlayingCard

public MHPlayingCard(int cardNumber)
Parameters:
cardFace -
cardSuit -
Method Detail

getImageGroup

public MHImageGroup getImageGroup()
Overrides:
getImageGroup in class MHActor

getImage

public java.awt.Image getImage()
Description copied from class: MHActor
Returns current animation frame.

Overrides:
getImage in class MHActor

equals

public boolean equals(MHPlayingCard otherCard)

equals

public boolean equals(int otherCardNumber)

equals

public boolean equals(int otherCardFace,
                      int otherCardSuit)

render

public void render(java.awt.Graphics2D g)
Description copied from class: MHActor
Draws the actor onto the sent graphics object based on its current action, animation frame number, and (x, y) coordinates

Specified by:
render in interface MHRenderable
Overrides:
render in class MHActor
Parameters:
g - The Graphics object on which to draw the actor

getFace

public int getFace()
Return an integer indicating the face of this card.

Returns:
An integer indicating the face of this card. See the constants defined in this class for possible values.

getCardNumber

public int getCardNumber()
Return the unique identifier for this card.

Returns:
The unique identifier for this card.

getSuit

public int getSuit()
Return an integer indicating the suit of this card.

Returns:
An integer indicating the suit of this card. See the constants defined in this class for possible values.

setFaceDown

public void setFaceDown(boolean isFaceDown)

isFaceDown

public boolean isFaceDown()

toString

public java.lang.String toString()
Returns a string representation of this card.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this card. For example, "Four of Diamonds".