]> git.ralfj.de Git - multypo.git/blobdiff - qt/player.h
show player name while typing
[multypo.git] / qt / player.h
index 4674255dabdf7fd9bfabe4d2b249761872e94b10..f28028f6687a7316f9832e6cb0af1725e28c6ab7 100644 (file)
@@ -4,19 +4,39 @@
 #include <QString>
 #include <QLabel>
 
 #include <QString>
 #include <QLabel>
 
+#define BASE_COLOR "green"
+#define READY_COLOR "orange"
+#define BASE_SIZE "45pt"
+#define SMALL_SIZE "25pt"
+
 class Player
 {
 class Player
 {
-private:
-       QString name;
-       QString currentLine;
-       QLabel* theLabel;
 public:
 public:
+    enum State {
+        Naming,
+        Waiting,
+        Typing
+    };
+    
        Player(QWidget* parent);
        Player(QWidget* parent);
+    
        void handleKey(QString);
        void handleKey(QString);
-       void resetText();
-       bool hasName();
-       QString getName();
-       QString getCurrentLine();
+    State getState() { return state; }
+
+       void nextWord();
+    QString getCurrentWord();
+       void wordComplete(int points);
+    void showScore();
+
+private:
+    int score;
+    QString name;
+    QString currentWord;
+    QLabel* theLabel;
+    
+    State state;
+    
+    void setLabel(QString body, QString color, QString header = "");
 };
 
 #endif // PLAYER_H
 };
 
 #endif // PLAYER_H