-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
65 lines (55 loc) · 1.4 KB
/
main.cpp
File metadata and controls
65 lines (55 loc) · 1.4 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
#include "oswidget.hpp"
#include "statikstring.hpp"
#include "window.hpp"
#include "square.hpp"
#include "button.hpp"
//todo: actplayer ref ki
const int XX=400;
const int YY=500;
class Mywindow : public window{
protected:
button *r;
button *q;
statikstring *u;
int sx;
int sy;
public:
Mywindow(){
sx=XX/20;
sy=(XX)/20;
for(int i=0; i<20; i++){
for(int j=0; j<20; j++){
t[i][j]=new Square(i*sx,YY-XX+j*sy,sx,sy);
w.push_back(t[i][j]);
}
}
r = new button(this,5,5,0,30,"New Game / RESET" , "reset");
u = new statikstring(this,150,70,0,30,"Next: ","uni");
q = new button(this,220,5,0,30,"Exit (or press esc)", "exit");
w.push_back(u);
w.push_back(r);
w.push_back(q);
}
void esemeny(std::string azonosito){
if(azonosito=="reset"){
for(int i=0; i<20; i++){
for(int j=0; j<20; j++){
t[i][j]->Setsquare(0);
}
}
kinyert=0;
}
if(azonosito=="exit"){
exit=true;
}
if(azonosito=="uni"){
u->unidraw(lepesszam, kinyert,XX,YY);
}
}
};
int main()
{
Mywindow *Mw = new Mywindow;
Mw->eventloop(XX,YY);
return 0;
}