X-Git-Url: https://git.ralfj.de/multypo.git/blobdiff_plain/48457df920b6f2c3747baa57366cc23389b3caca..318e322c3cd72e6a7f692c6f7c7770c0e15720c8:/qt/player.h?ds=sidebyside diff --git a/qt/player.h b/qt/player.h index 0facdd5..3817866 100644 --- a/qt/player.h +++ b/qt/player.h @@ -6,21 +6,32 @@ 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