Wt examples: hangman/WordWidget.h Source File

Wt examples 4.10.4

Loading...
Searching...
No Matches
WordWidget.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 WORD_WIDGET_H_
9#define WORD_WIDGET_H_
10
11#include <Wt/WContainerWidget.h>
12
13 class WordWidget : public Wt::WContainerWidget
14{
15public:
16 WordWidget();
17
18 std::string word() const { return word_; }
19
20 void init(const std::string &word);
21 bool guess(char c);
22
23 bool won();
24
25private:
26 std::vector<Wt::WText*> wordLetters_;
27 std::string word_;
28
29 unsigned displayedLetters_ = 0;
30};
31
32#endif //WORD_WIDGET_H_
WordWidget
Definition WordWidget.h:14
WordWidget::WordWidget
WordWidget()
Definition WordWidget.C:11
WordWidget::init
void init(const std::string &word)
Definition WordWidget.C:16
WordWidget::guess
bool guess(char c)
Definition WordWidget.C:29
WordWidget::wordLetters_
std::vector< Wt::WText * > wordLetters_
Definition WordWidget.h:26
WordWidget::word
std::string word() const
Definition WordWidget.h:18
WordWidget::displayedLetters_
unsigned displayedLetters_
Definition WordWidget.h:29
WordWidget::won
bool won()
Definition WordWidget.C:44
WordWidget::word_
std::string word_
Definition WordWidget.h:27