#include <HangmanWidget.h>
Definition at line 20 of file HangmanWidget.h.
◆ HangmanWidget()
HangmanWidget::HangmanWidget |
( |
const std::string & |
name | ) |
|
Definition at line 27 of file HangmanWidget.C.
28 : WContainerWidget(),
31{
32 setContentAlignment(AlignmentFlag::Center);
33
34 title_ = addWidget(std::make_unique<WText>(tr(
"hangman.readyToPlay")));
35
36 word_ = addWidget(std::make_unique<WordWidget>());
38 images_ = addWidget(std::make_unique<ImagesWidget>(MaxGuesses));
39
40 letters_ = addWidget(std::make_unique<LettersWidget>());
42
43 language_ = addWidget(std::make_unique<WComboBox>());
44 language_->addItem(tr(
"hangman.englishWords").arg(18957));
45 language_->addItem(tr(
"hangman.dutchWords").arg(1688));
46
47 addWidget(std::make_unique<WBreak>());
48
49 newGameButton_ = addWidget(std::make_unique<WPushButton>(tr(
"hangman.newGame")));
51
53}
◆ newGame()
void HangmanWidget::newGame |
( |
| ) |
|
|
private |
Definition at line 55 of file HangmanWidget.C.
56{
57 WString title(tr("hangman.guessTheWord"));
59
62
63
64
65
72}
std::wstring RandomWord(Dictionary dictionary)
◆ registerGuess()
void HangmanWidget::registerGuess |
( |
char |
c | ) |
|
|
private |
Definition at line 74 of file HangmanWidget.C.
75{
78
79 if (!correct) {
82 }
83 }
84
86 WString status = tr("hangman.youHang");
88
92
97
101
103 }
104}
◆ scoreUpdated()
Wt::Signal< int > & HangmanWidget::scoreUpdated |
( |
| ) |
|
|
inline |
◆ badGuesses_
int HangmanWidget::badGuesses_ |
|
private |
◆ images_
◆ language_
Wt::WComboBox* HangmanWidget::language_ |
|
private |
◆ letters_
◆ name_
std::string HangmanWidget::name_ |
|
private |
◆ newGameButton_
Wt::WPushButton* HangmanWidget::newGameButton_ |
|
private |
◆ scoreUpdated_
Wt::Signal<int> HangmanWidget::scoreUpdated_ |
|
private |
◆ statusText_
Wt::WText* HangmanWidget::statusText_ |
|
private |
◆ title_
Wt::WText* HangmanWidget::title_ |
|
private |
◆ word_
The documentation for this class was generated from the following files: