-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcgame.cpp
More file actions
76 lines (55 loc) · 1.32 KB
/
cgame.cpp
File metadata and controls
76 lines (55 loc) · 1.32 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
69
70
71
72
73
74
75
76
#ifdef ONLINE_PLAY
#include <QPushButton>
#include "cgame.h"
#include "ui_cgame.h"
#include "define.h"
CGame::CGame(QWidget *parent) :
QDialog(parent),
ui(new Ui::CGame)
{
ui->setupUi(this);
ui->buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Ok"));
flags = 0;
}
CGame::~CGame()
{
delete ui;
}
void CGame::set_flags(unsigned int f)
{
flags = f;
if (flags & QUEEN_SPADE_f)
ui->checkBox->setChecked(true);
if (flags & PERFECT_100_f)
ui->checkBox_2->setChecked(true);
if (flags & OMNIBUS_f)
ui->checkBox_3->setChecked(true);
if (flags & NO_TRICK_BONUS_f)
ui->checkBox_4->setChecked(true);
if (flags & NEW_MOON_f)
ui->checkBox_5->setChecked(true);
if (flags & NO_DRAW_f)
ui->checkBox_6->setChecked(true);
}
unsigned int CGame::get_flags()
{
return flags;
}
void CGame::on_buttonBox_accepted()
{
flags = 0;
if (ui->checkBox->isChecked())
flags = QUEEN_SPADE_f;
if (ui->checkBox_2->isChecked())
flags |= PERFECT_100_f;
if (ui->checkBox_3->isChecked())
flags |= OMNIBUS_f;
if (ui->checkBox_4->isChecked())
flags |= NO_TRICK_BONUS_f;
if (ui->checkBox_5->isChecked())
flags |= NEW_MOON_f;
if (ui->checkBox_6->isChecked())
flags |= NO_DRAW_f;
}
#endif // ONLINE_PLAY