class Player
{
-private:
- QString name;
- QString currentLine;
- QLabel* theLabel;
- bool modifyable;
public:
+ enum State {
+ Naming,
+ Waiting,
+ Typing
+ };
+
Player(QWidget* parent);
- bool handleKey(QString); /* returns whether a char was added */
- void resetText();
- bool hasName();
- QString getName();
- QString getCurrentLine();
- void setWaiting(QString labeltext);
+
+ void handleKey(QString);
+ State getState() { return state; }
+
+ void nextWord();
+ QString getCurrentWord();
+ void wordComplete(int points);
+ void showScore();
- int score;
+private:
+ int score;
+ QString name;
+ QString currentWord;
+ QLabel* theLabel;
+
+ State state;
+
+ void updateLabel();
};
#endif // PLAYER_H