AbstractDisplay Class Reference

Abstract display engine. More...

#include <abstractdisplay.h>

Inheritance diagram for AbstractDisplay:

Inheritance graph
[legend]
Collaboration diagram for AbstractDisplay:

Collaboration graph
[legend]
List of all members.

Public Slots

virtual void convertMousePress (QPoint mouse, int &playerNumber, int &cardNumber)=0
 Convert the mouse position to a card number for one of the players.
virtual void createCardSprites ()
 Load all card sprites.

Public Member Functions

 AbstractDisplay (Deck *deck, QGraphicsScene *scene, ThemeManager *theme, int advancePeriod, QGraphicsView *parent)
 Constructor for the engine.
virtual ~AbstractDisplay ()
 Destructor.
void setDeck (Deck *deck)
 Set a new deck object.
virtual void reset ()
 Reset the display.
virtual void start ()=0
 Start the display.
virtual void play (int cardNumber, int playerNumber, int phase)=0
 Play a card on the display.
virtual void turn (int cardNumber)=0
 Turn a card on the display.
virtual void remove (int winnerPosition, int cardNumber, int delta)=0
 Remove the given card from the display.
QGraphicsScene * scene ()
 Retrieve the graphics scene of this display.

Protected Attributes

DeckmDeck
 The card deck.
QGraphicsScene * mScene
 The work canvas.
QGraphicsView * mView
int mAdvancePeriod
 Canvas advance period [ms].
QList< QGraphicsItem * > mSprites
 Text sprite list.
ThemeManagermTheme
 Theme manager.

Static Protected Attributes

static QHash< int, CardSprite * > mCards
 Store the card sprite indexed by the card value.

Detailed Description

Abstract display engine.

Definition at line 47 of file abstractdisplay.h.


Constructor & Destructor Documentation

AbstractDisplay::AbstractDisplay Deck deck,
QGraphicsScene *  scene,
ThemeManager theme,
int  advancePeriod,
QGraphicsView *  parent
 

Constructor for the engine.

Parameters:
deck The card deck
scene The graphics scene to work with
theme The theme manager
advancePeriod The advance period [ms]
parent The parent object

Definition at line 38 of file abstractdisplay.cpp.

References createCardSprites(), mAdvancePeriod, mScene, mSprites, mTheme, mView, and setDeck().

Here is the call graph for this function:

AbstractDisplay::~AbstractDisplay  )  [virtual]
 

Destructor.

Definition at line 61 of file abstractdisplay.cpp.

References mSprites.


Member Function Documentation

virtual void AbstractDisplay::convertMousePress QPoint  mouse,
int &  playerNumber,
int &  cardNumber
[pure virtual, slot]
 

Convert the mouse position to a card number for one of the players.

Parameters:
mouse The mouse coordinates [screen coordinates]
playerNumber The resulting player number [0-1]
cardNumber The resulting card number [0-7]

Implemented in DisplayIntro, and DisplayTwo.

void AbstractDisplay::createCardSprites  )  [virtual, slot]
 

Load all card sprites.

Definition at line 88 of file abstractdisplay.cpp.

References Deck::cardNumber(), mAdvancePeriod, mCards, mDeck, mScene, mTheme, and CardSprite::setBackside().

Referenced by AbstractDisplay().

virtual void AbstractDisplay::play int  cardNumber,
int  playerNumber,
int  phase
[pure virtual]
 

Play a card on the display.

The card is moved from its current position to the card deposit.

Parameters:
cardNumber The card number [0-7 ]
playerNumber The player number [0-1]
phase Movement phase (1st part, 2nd part, etc) [optional]

Implemented in DisplayIntro, and DisplayTwo.

virtual void AbstractDisplay::remove int  winnerPosition,
int  cardNumber,
int  delta
[pure virtual]
 

Remove the given card from the display.

Parameters:
winnerPosition The position of the winner (0,1)
cardNumber The number of the card
delta Card offset from target position (0,1,2,...)

Implemented in DisplayIntro, and DisplayTwo.

void AbstractDisplay::reset  )  [virtual]
 

Reset the display.

Clear all sprites etc.

Definition at line 81 of file abstractdisplay.cpp.

References mCards.

QGraphicsScene* AbstractDisplay::scene  )  [inline]
 

Retrieve the graphics scene of this display.

Returns:
The QGraphicsScene of this display.

Definition at line 102 of file abstractdisplay.h.

References mScene.

Referenced by DisplayTwo::changeTheme(), DisplayIntro::changeTheme(), DisplayIntro::DisplayIntro(), DisplayTwo::DisplayTwo(), and DisplayIntro::start().

void AbstractDisplay::setDeck Deck deck  ) 
 

Set a new deck object.

Parameters:
deck The deck

Definition at line 74 of file abstractdisplay.cpp.

References mDeck.

Referenced by AbstractDisplay().

virtual void AbstractDisplay::start  )  [pure virtual]
 

Start the display.

Implemented in DisplayIntro, and DisplayTwo.

Referenced by Mainwindow::Mainwindow().

virtual void AbstractDisplay::turn int  cardNumber  )  [pure virtual]
 

Turn a card on the display.

The card is flipped backside to frontside.

Parameters:
cardNumber The card number [0-7]

Implemented in DisplayIntro, and DisplayTwo.


Member Data Documentation

int AbstractDisplay::mAdvancePeriod [protected]
 

Canvas advance period [ms].

Definition at line 126 of file abstractdisplay.h.

Referenced by AbstractDisplay(), createCardSprites(), and DisplayTwo::DisplayTwo().

QHash< int, CardSprite * > AbstractDisplay::mCards [static, protected]
 

Store the card sprite indexed by the card value.

Definition at line 130 of file abstractdisplay.h.

Referenced by createCardSprites(), DisplayTwo::deal(), DisplayTwo::getCardSprite(), DisplayIntro::loop(), reset(), DisplayTwo::start(), and DisplayIntro::start().

Deck* AbstractDisplay::mDeck [protected]
 

The card deck.

Definition at line 120 of file abstractdisplay.h.

Referenced by createCardSprites(), and setDeck().

QGraphicsScene* AbstractDisplay::mScene [protected]
 

The work canvas.

Definition at line 122 of file abstractdisplay.h.

Referenced by AbstractDisplay(), createCardSprites(), and scene().

QList<QGraphicsItem*> AbstractDisplay::mSprites [protected]
 

Text sprite list.

Definition at line 128 of file abstractdisplay.h.

Referenced by AbstractDisplay(), DisplayTwo::DisplayTwo(), DisplayIntro::start(), and ~AbstractDisplay().

ThemeManager* AbstractDisplay::mTheme [protected]
 

Theme manager.

Definition at line 132 of file abstractdisplay.h.

Referenced by AbstractDisplay(), createCardSprites(), DisplayTwo::DisplayTwo(), and DisplayIntro::start().

QGraphicsView* AbstractDisplay::mView [protected]
 

Definition at line 124 of file abstractdisplay.h.

Referenced by AbstractDisplay(), DisplayTwo::changeTheme(), and DisplayIntro::changeTheme().


The documentation for this class was generated from the following files:
Generated on Tue May 1 09:34:40 2007 for LSkat by  doxygen 1.4.6