fix score
[multypo.git] / qt / multypo.h
index f10a5d40e947d17b2a205a2340857529eef82815..66728a6d8264352068f53bb381ed595afed3ba4c 100644 (file)
@@ -2,29 +2,42 @@
 #define MULTIKBD_H
 
 #include <QWidget>
+#include <QMap>
+#include <QFile>
 
-class QLabel;
+#include "player.h"
 
 class MultypoWindow : public QWidget
 {
        Q_OBJECT
        
 public:
+    enum State {
+        Naming,
+        Playing,
+        Scoring
+    };
+    
        explicit MultypoWindow(QWidget *parent = 0);
        ~MultypoWindow();
 
        bool handleX11Event(XEvent *event);
 
-protected:
-       virtual void showEvent (QShowEvent *);
-
 private:
        void handleKeyPress(int device, QString string);
-
-private:
+       void nextWord();
+    bool allPlayersWaiting();
+    int typingPlayers();
+    void setLabel(QString text, QString color);
+
+    State state; // naming iff (no players or any player is naming)
+    QString currentWord; // defined iff state == Playing
+    QMap<int, Player*> players;
+    
        bool xiInited;
        int xiOpcode;
        QLabel *mainLabel;
+       QFile words;
 };
 
 #endif // MULTIKBD_H