kwin4player.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           KWin4Player  
00003                           -------------------
00004     begin                : August 2001
00005     copyright            : (C) 1995-2007 by Martin Heni
00006     email                : kde@heni-online.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef KWIN4_PLAYER_H
00019 #define KWIN4_PLAYER_H
00020 
00021 // KDE i9ncludes
00022 #include <kplayer.h>
00023 #include <kconfiggroup.h>
00024 
00025 
00026 // Local includes
00027 #include "score.h"
00028 
00029 
00035 class KWin4Player : public KPlayer
00036 {
00037   Q_OBJECT
00038           
00039   public:
00042     KWin4Player();
00043     
00048     int rtti() const {return 1;}
00049     
00054     void setStatus(Score *s) {mStatus=s;}
00055     
00059     Score* status(){return mStatus;}
00060     
00064     void readConfig(KConfigGroup& config);
00065     
00069     void writeConfig(KConfigGroup& config);
00070     
00073     void incWin();
00074     
00077     void incRemis();
00078     
00081     void incLost();
00082     
00085     void incBrk();
00086     
00089     int win() {return mAllWin.value();}
00090     
00093     int lost() {return mAllLost.value();}
00094     
00097     int brk() {return mAllBrk.value();}
00098     
00101     int remis() {return mAllRemis.value();}
00102     
00106     void resetStats(bool all=true);
00107 
00108   protected slots:
00114     void slotPlayerPropertyChanged(KGamePropertyBase *prop,KPlayer *player);
00115 
00116   private:
00117     // One session wins
00118     KGamePropertyInt mWin;
00119 
00120     // One session draws
00121     KGamePropertyInt mRemis;
00122 
00123     // One session losses
00124     KGamePropertyInt mLost;
00125 
00126     // One session aborted games
00127     KGamePropertyInt mBrk;
00128 
00129     // All time wins
00130     KGamePropertyInt mAllWin;
00131 
00132     // All time draws
00133     KGamePropertyInt mAllRemis;
00134 
00135     // All time losses
00136     KGamePropertyInt mAllLost;
00137 
00138     // All time aborted games
00139     KGamePropertyInt mAllBrk;
00140 
00141     // Status object: Connects player to GUI widget
00142     Score *mStatus;
00143 };
00144 
00145 #endif // KWIN4_PLAYER_H
00146 

Generated on Sun Mar 4 10:56:43 2007 for KWin4 by  doxygen 1.4.6