Wt examples  4.10.4
HangmanWidget.h
Go to the documentation of this file.
1 // This may look like C code, but it's really -*- C++ -*-
2 /*
3  * Copyright (C) 2011 Emweb bv, Herent, Belgium
4  *
5  * See the LICENSE file for terms of use.
6  */
7 
8 #ifndef HANGMAN_WIDGET_H_
9 #define HANGMAN_WIDGET_H_
10 
11 #include <Wt/WContainerWidget.h>
12 
13 #include <vector>
14 
15 class WordWidget;
16 class ImagesWidget;
17 class LettersWidget;
18 
20 {
21 public:
22  explicit HangmanWidget(const std::string &name);
23 
25 
26 private:
27  Wt::WText *title_ = nullptr;
28 
29  WordWidget *word_ = nullptr;
30  ImagesWidget *images_ = nullptr;
31  LettersWidget *letters_ = nullptr;
32 
33  Wt::WText *statusText_ = nullptr;
36 
38 
39  std::string name_;
40 
41  int badGuesses_ = 0;
42 
43  void registerGuess(char c);
44 
45  void newGame();
46 };
47 
48 #endif //HANGMAN_WIDGET_H_
std::string name_
Definition: HangmanWidget.h:39
void registerGuess(char c)
Definition: HangmanWidget.C:72
Wt::Signal< int > & scoreUpdated()
Definition: HangmanWidget.h:24
LettersWidget * letters_
Definition: HangmanWidget.h:31
Wt::WText * statusText_
Definition: HangmanWidget.h:33
Wt::WComboBox * language_
Definition: HangmanWidget.h:34
ImagesWidget * images_
Definition: HangmanWidget.h:30
Wt::WText * title_
Definition: HangmanWidget.h:27
HangmanWidget(const std::string &name)
Definition: HangmanWidget.C:27
Wt::Signal< int > scoreUpdated_
Definition: HangmanWidget.h:37
WordWidget * word_
Definition: HangmanWidget.h:29
Wt::WPushButton * newGameButton_
Definition: HangmanWidget.h:35