abstractdisplay.h

Go to the documentation of this file.
00001 #ifndef ABSTRACT_DISPLAY_H
00002 #define ABSTRACT_DISPLAY_H
00003 /*
00004    This file is part of the KDE games lskat program
00005    Copyright (c) 2006 Martin Heni <kde@heni-online.de>
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License as published by the Free Software Foundation; either
00010    version 2 of the License, or (at your option) any later version.
00011 
00012    This library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 // Qt includes
00024 #include <QGraphicsScene>
00025 #include <QGraphicsItem>
00026 #include <QGraphicsView>
00027 #include <QList>
00028 #include <QHash>
00029 
00030 // KDE includes
00031 #include <kdebug.h>
00032 
00033 // local includes
00034 
00035 // Forward declaration
00036 class Deck;
00037 class Player;
00038 class CardSprite;
00039 class TextSprite;
00040 class ThemeManager;
00041 
00042 
00043 
00047 class AbstractDisplay : public QObject
00048 {
00049   Q_OBJECT
00050 
00051   public:
00059     AbstractDisplay(Deck* deck, QGraphicsScene* scene, ThemeManager* theme, int advancePeriod, QGraphicsView* parent);
00060 
00063     virtual ~AbstractDisplay();
00064 
00068     void setDeck(Deck* deck);  
00069 
00072     virtual void reset();
00073 
00076     virtual void start() = 0; 
00077 
00084     virtual void play(int cardNumber, int playerNumber, int phase) = 0;
00085 
00090     virtual void turn(int cardNumber) = 0;
00091 
00097     virtual void remove(int winnerPosition, int cardNumber, int delta) = 0;
00098 
00102     QGraphicsScene* scene() {return  mScene;} 
00103 
00104   
00105   public slots:
00111     virtual void convertMousePress(QPoint mouse, int& playerNumber, int& cardNumber) = 0;
00112 
00115     virtual void createCardSprites();
00116 
00117 
00118   protected:
00120     Deck* mDeck;
00122     QGraphicsScene* mScene;
00123     // The graphics view
00124     QGraphicsView* mView;
00126     int mAdvancePeriod;
00128     QList<QGraphicsItem*> mSprites;
00130     static QHash<int,CardSprite*> mCards;
00132     ThemeManager* mTheme;
00133 };
00134 
00135 
00136 #endif

Generated on Tue May 1 09:34:40 2007 for LSkat by  doxygen 1.4.6