- QLabel *label = new QLabel(this);
- layout()->addWidget(label);
- players[device] = label;
+ players[device] = new Player(this);
+ }
+ players[device]->handleKey(string);
+
+ if (gameStarted) { // ingame
+
+ } else { // name entering phase
+ bool allHaveNames = true;
+ for (QMap<int, Player*>::Iterator it = players.begin(); it != players.end(); ++it) {
+ if (! it.value()->hasName()) {
+ allHaveNames = false;
+ break;
+ }
+ }
+ if (!players.empty() && allHaveNames) {
+ gameStarted = true;
+ nextWord();
+ }