-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathintermediate_window.h
More file actions
69 lines (52 loc) · 1.5 KB
/
intermediate_window.h
File metadata and controls
69 lines (52 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//
// This is a GUI support code to the chapters 12-16 of the book
// "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup
//
#ifndef INTERMEDIATE_WINDOW_H
#define INTERMEDIATE_WINDOW_H
#include "GUI.h" // for Simple_window only (doesn't really belong in Window.h)
#include "Graph.h"
#include "Score_Display.h"
using namespace Graph_lib;
//------------------------------------------------------------------------------
struct intermediate_window : Graph_lib::Window {
intermediate_window(Point xy, int w, int h, const string& title, string playername);
bool wait_for_button(); // simple event loop
bool observation_period;
vector<int> choices;
const int rounds = 64;
int choices_left = 64;
int score = 0;
int guesses = 1;
double probM = 0.0;
double probW = 0.0;
double probB = 0.0;
double timesCorrect = 0.0;
string playername;
bool win = false;
private:
Out_box scoreDisp;
Out_box computer_correct;
Out_box choices_to_go;
Image observation;
Image guessing;
Image computerRight;
Image userWin;
Image background;
Button Maroon;
Button White;
Button Black;
Button Quit;
Score_Display_window uniqueScore;
bool button_pushed; // implementation detail
static void cb_maroon(Address, Address);
static void cb_white(Address, Address);
static void cb_black(Address, Address);
static void cb_quit(Address, Address);
void maroon();
void white();
void black();
void quitButton();
};
#endif
//------------------------------------------------------------------------------