fix score
[multypo.git] / qt / multypo.h
index 49b70b1bdf7d079d5252c97c81743e8245809d92..66728a6d8264352068f53bb381ed595afed3ba4c 100644 (file)
@@ -3,14 +3,21 @@
 
 #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();
 
@@ -18,13 +25,19 @@ public:
 
 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;
-
-       QMap<int, QLabel*> players;
+       QFile words;
 };
 
 #endif // MULTIKBD_H