-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdialogbuyterre.cpp
83 lines (70 loc) · 1.66 KB
/
dialogbuyterre.cpp
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
77
78
79
80
81
82
83
#include "dialogbuyterre.h"
#include "ui_dialogbuyterre.h"
#include "game.h"
DialogBuyTerre::DialogBuyTerre(QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogBuyTerre)
{
ui->setupUi(this);
}
DialogBuyTerre::~DialogBuyTerre()
{
delete ui;
}
void DialogBuyTerre::getInfo(int x, int y, bool value){
m_x = x;
m_y = y;
m_value = value;
}
void DialogBuyTerre::on_pushButton_clicked()
{
this->close();
}
void DialogBuyTerre::on_pushButton_2_clicked()
{
Game& game = Game::Instance();
game.createUnit( m_x, m_y, m_type, m_value, 1);
this->close();
}
void DialogBuyTerre::on_pushButton_3_clicked()
{
Game& game = Game::Instance();
game.createUnit( m_x, m_y, m_type, m_value, 2);
this->close();
}
void DialogBuyTerre::on_pushButton_4_clicked()
{
Game& game = Game::Instance();
game.createUnit( m_x, m_y, m_type, m_value, 3);
this->close();
}
void DialogBuyTerre::on_pushButton_5_clicked()
{
Game& game = Game::Instance();
game.createUnit( m_x, m_y, m_type, m_value, 4);
this->close();
}
void DialogBuyTerre::on_pushButton_6_clicked()
{
Game& game = Game::Instance();
game.createUnit( m_x, m_y, m_type, m_value, 5);
this->close();
}
void DialogBuyTerre::on_pushButton_7_clicked()
{
Game& game = Game::Instance();
game.createUnit( m_x, m_y, m_type, m_value, 6);
this->close();
}
void DialogBuyTerre::on_pushButton_8_clicked()
{
Game& game = Game::Instance();
game.createUnit( m_x, m_y, m_type, m_value, 7);
this->close();
}
void DialogBuyTerre::on_pushButton_9_clicked()
{
Game& game = Game::Instance();
game.createUnit( m_x, m_y, m_type, m_value, 8);
this->close();
}