KardPlaySequence Class Reference

#include <kardplaysequence.h>

Collaboration diagram for KardPlaySequence:

Collaboration graph
[legend]

List of all members.


Detailed Description

This creates a nice play sequence of cards, laying them out based on the player layout and the sequence of cards played.

Note:
Currently we only have the interface defined for up to four players.
Todo:
Make the layout creation general for any number of players.
Author:
John Schneiderman

Public Member Functions

const CardSequencecardSequence (int playerIndex) const
void clear ()
bool isFaceUp () const
 KardPlaySequence (int numberOfPlayers, QWidget *parent=0)
 KardPlaySequence (QWidget *parent=0)
int numberOfPlayers () const
void setCardBackImage (const QString &backImage)
void setCardFrontImagePath (const QString &imagePath)
void setCardSequence (const CardSequence &sequence, vector< int > playerCardIndexes)
void setCardSequence (const CardSequence &sequence, int starterPlayerIndex)
void setFaceUp (bool faceUp)
void setNumberOfPlayers (int numberOfPlayers)
QSize sizeHint ()
 ~KardPlaySequence ()

Protected Member Functions

virtual void paintEvent (QPaintEvent *event)

Properties

bool m_faceUp
int m_numberOfPlayers

Constructor & Destructor Documentation

KardPlaySequence::KardPlaySequence ( QWidget *  parent = 0  ) 

The creates an empty play sequence layout.

Parameters:
parent is the parent of our widget.

KardPlaySequence::KardPlaySequence ( int  numberOfPlayers,
QWidget *  parent = 0 
)

This creates a layout for a specific number of players.

Parameters:
numberOfPlayers is the number of players needed for this layout.
parent is the parent of our widget.
Exceptions:
KardsGTError if the number of players is greater than our currently defined maximum.

KardPlaySequence::~KardPlaySequence (  ) 

Destructor for our widget.


Member Function Documentation

const CardSequence & KardPlaySequence::cardSequence ( int  playerIndex  )  const

Gets the card sequence for a specific player.

Parameters:
playerIndex is the index of the player we want.
Returns:
the card sequence for the player.
Exceptions:
KardsGTError if the playerIndex is out of range.

void KardPlaySequence::clear (  ) 

This clears all of the play sequences.

bool KardPlaySequence::isFaceUp (  )  const

An accessor if we're display all the kards in the layout face up.

Returns:
true if all the kards are face up, false elsewise.

int KardPlaySequence::numberOfPlayers (  )  const

An accessor to how many players our layout is setup for.

Returns:
the number of players in our layout.

void KardPlaySequence::paintEvent ( QPaintEvent *  event  )  [protected, virtual]

This paints our widget.

Parameters:
event is the generating event.

void KardPlaySequence::setCardBackImage ( const QString &  backImage  ) 

This sets the image used for the back of the kards.

Parameters:
backImage is the file-name of the image for the back of the kard.

void KardPlaySequence::setCardFrontImagePath ( const QString &  imagePath  ) 

This sets the directory that has the kard front images.

Parameters:
imagePath is the path to the directory for our kard images.

void KardPlaySequence::setCardSequence ( const CardSequence sequence,
vector< int >  playerCardIndexes 
)

This sets all of the card sequences. It places each of the kards according to the list of player indexes.

Parameters:
sequence is the sequence of cards.
playerCardIndexes is a list of each kard for the corresponding player.
Exceptions:
KardsGTError if the sequence list and the playerCardIndexes are not the same size.

void KardPlaySequence::setCardSequence ( const CardSequence sequence,
int  starterPlayerIndex 
)

This sets all of the card sequences. It alternates kards starting with the index of the player for the first kard in the sequence.

Parameters:
sequence is the sequence of cards.
starterPlayerIndex is the player index who starts the sequence of cards.
Exceptions:
KardsGTError if the startPlayerIndex is out of range.
Note:
The first player index is 0.

void KardPlaySequence::setFaceUp ( bool  faceUp  ) 

A modifier to set all of the cards in the play sequence face up.

Parameters:
faceUp true if all the cards should be face up, false elsewise.

void KardPlaySequence::setNumberOfPlayers ( int  numberOfPlayers  ) 

A modifier to set the number of players in our layout.

Parameters:
numberOfPlayers is the number of players for our layout.
Exceptions:
KardsGTError if the number of players is greater than our currently defined maximum.

QSize KardPlaySequence::sizeHint (  ) 

The preferred size of our widget.


Property Documentation

bool KardPlaySequence::m_faceUp [read, write]

Parameters:
m_faceUp is true if we want the player's cards to be face up, false elsewise.

int KardPlaySequence::m_numberOfPlayers [read, write]

Parameters:
m_numberOfPlayers are the number of player's we're displaying.


The documentation for this class was generated from the following files:

Generated on Tue Aug 12 23:24:01 2008 for KardsGT by  doxygen 1.5.5