-
Notifications
You must be signed in to change notification settings - Fork 0
/
Buttons.cpp
136 lines (110 loc) · 2.92 KB
/
Buttons.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/**
* Copyright (C) Kevin J. Estevez (kenystev) and Luis C. Isaula (lisaula)
*
* GNU GENERAL PUBLIC LICENSE Version 2
* The licenses for most software are designed to take away your
* freedom to share and change it. By contrast, the GNU General Public
* License is intended to guarantee your freedom to share and change free
* software--to make sure the software is free for all its users. This
* General Public License applies to most of the Free Software
* Foundation's software and to any other program whose authors commit to
* using it.
*/
#include "Buttons.h"
#include "RaceGear.h"
CarButton::CarButton(int num,int x_position, int y_position, Image* up, Image* down, RosalilaGraphics* painter) : Button(x_position,y_position,up,down,painter)
{
this->num=num;
}
CarButton::~CarButton()
{
//dtor
}
void CarButton::funcionamiento()
{
cout<<"Funciona"<<endl;
}
//TrackButton
TrackButton::TrackButton(int i,string name,int x_position, int y_position, Image* up, Image* down, RosalilaGraphics* painter) : Button(x_position,y_position,up,down,painter)
{
this->name=name;
this->num_pista=i;
}
TrackButton::~TrackButton()
{
}
void TrackButton::funcionamiento()
{
}
//PlayButton
PlayButton::PlayButton(int x_position, int y_position, Image* up, Image* down,RosalilaGraphics* painter, Game* game) :Button(x_position,y_position,up,down,painter)
{
this->game = game;
}
PlayButton::PlayButton(){
}
void PlayButton::funcionamiento(){
game->setScreen(((RaceGear*)game)->SELECT);
}
PlayButton::~PlayButton()
{
// delete pista;
//dtor
}
//BackButton
BackButton::BackButton(int x_position, int y_position, Image* up, Image* down,RosalilaGraphics* painter, Game* game): Button(x_position,y_position,up,down,painter)
{
this->game = game;
}
void BackButton:: funcionamiento(){
game->setScreen(((RaceGear*)game)->MENU);
}
BackButton::BackButton(){
}
BackButton::~BackButton()
{
//dtor
}
//ExitButton
ExitButton::ExitButton(int x_position, int y_position, Image* up, Image* down,RosalilaGraphics* painter) : Button(x_position,y_position,up,down,painter)
{
//ctor
}
ExitButton::ExitButton(){
}
void ExitButton::funcionamiento(){
exit(0);
}
ExitButton::~ExitButton()
{
//dtor
}
//InstrButton
InstrButton::InstrButton(int x_position, int y_position, Image* up, Image* down,RosalilaGraphics* painter, Game* game) : Button(x_position,y_position,up,down,painter)
{
this->game = game;
}
InstrButton::InstrButton(){
}
void InstrButton:: funcionamiento(){
game->setScreen(((RaceGear*)game)->INSTRUCTION);
}
InstrButton::~InstrButton()
{
//dtor
}
//RankButton
RankButton::RankButton(int x_position, int y_position, Image* up, Image* down,RosalilaGraphics* painter, Game* game) : Button(x_position,y_position,up,down,painter)
{
this->game = game;
//ctor
}
RankButton::RankButton(){
}
void RankButton:: funcionamiento(){
game->setScreen(((RaceGear*)game)->RANKING);
}
RankButton::~RankButton()
{
//dtor
}