projects
/
multypo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix score
[multypo.git]
/
qt
/
multypo.h
diff --git
a/qt/multypo.h
b/qt/multypo.h
index 400d4c995eb848d19bbfeebf13d75d4bbbad6481..66728a6d8264352068f53bb381ed595afed3ba4c 100644
(file)
--- a/
qt/multypo.h
+++ b/
qt/multypo.h
@@
-2,26
+2,42
@@
#define MULTIKBD_H
#include <QWidget>
#define MULTIKBD_H
#include <QWidget>
+#include <QMap>
+#include <QFile>
+
+#include "player.h"
class MultypoWindow : public QWidget
{
Q_OBJECT
public:
class MultypoWindow : public QWidget
{
Q_OBJECT
public:
+ enum State {
+ Naming,
+ Playing,
+ Scoring
+ };
+
explicit MultypoWindow(QWidget *parent = 0);
~MultypoWindow();
bool handleX11Event(XEvent *event);
explicit MultypoWindow(QWidget *parent = 0);
~MultypoWindow();
bool handleX11Event(XEvent *event);
-protected:
- virtual void showEvent (QShowEvent *);
-
private:
void handleKeyPress(int device, QString string);
private:
void handleKeyPress(int device, QString string);
+ void nextWord();
+ bool allPlayersWaiting();
+ int typingPlayers();
+ void setLabel(QString text, QString color);
-private:
+ 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;
bool xiInited;
int xiOpcode;
+ QLabel *mainLabel;
+ QFile words;
};
#endif // MULTIKBD_H
};
#endif // MULTIKBD_H