X-Git-Url: https://git.ralfj.de/multypo.git/blobdiff_plain/e6207dc52430a9fcbfd7df03f46c2876fc05154b..4978fd909202554270ec12c87d78a990001b17e4:/qt/player.h diff --git a/qt/player.h b/qt/player.h index 7b78283..cb628cc 100644 --- a/qt/player.h +++ b/qt/player.h @@ -4,22 +4,39 @@ #include #include +#define BASE_COLOR "green" +#define READY_COLOR "orange" +#define BASE_SIZE "45pt" +#define SMALL_SIZE "25pt" + class Player { -private: - QString name; - QString currentLine; - QLabel* theLabel; - bool modifyable; public: + enum State { + Naming, + Waiting, + Typing + }; + Player(QWidget* parent); + void handleKey(QString); - void resetText(); - bool hasName(); - QString getName(); - QString getCurrentLine(); - int score; - void setWaiting(QString labeltext); + 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); }; #endif // PLAYER_H