Skip to content
Snippets Groups Projects
Commit bd35ab93 authored by Bolla Péter's avatar Bolla Péter
Browse files

Update main.cpp

parent 930a2ae9
Branches
No related tags found
No related merge requests found
...@@ -11,63 +11,28 @@ const int WID = 600, HEIG = 600, F_SIZE = HEIG/8; ...@@ -11,63 +11,28 @@ const int WID = 600, HEIG = 600, F_SIZE = HEIG/8;
class MyApp: public App class MyApp: public App
{ {
public: public:
MyApp(int width, int height): Chess *chessboard;
App(width, height) vector<Button*> Field;
MyApp(int width, int height): App(width, height)
{ {
chessboard = new Chess(); chessboard = new Chess();
cout<<endl;
for(int i = 0; i<chessboard->GetTable().size(); i++) for(int i = 0; i<chessboard->GetTable().size(); i++)
{ {
cout<<i<<". Button\n";
Button* b = new Button(this, Button* b = new Button(this,
i%8*F_SIZE, HEIG-(i/8+1)*F_SIZE, i%8*F_SIZE, HEIG-(i/8+1)*F_SIZE,
F_SIZE, F_SIZE, F_SIZE, F_SIZE,
[](){}, [](){},
chessboard->GetSquare(i)); chessboard,
i);
Field.push_back(b); Field.push_back(b);
/*switch(chessboard->GetPiece(i).type)
{
case Pawn:
{
cout<<'p';
break;
}
case Rook:
{
cout<<'r';
break;
}
case Knight:
{
cout<<'n';
break;
}
case Bishop:
{
cout<<'b';
}
case King:
{
cout<<'k';
}
case Queen:
{
cout<<'q';
}
case Empty:
{
cout<<'*';
break;
}
}
if(i%8 == 7) cout<<endl;*/
} }
} }
protected:
Chess *chessboard;
vector<Button*> Field;
}; };
...@@ -75,8 +40,7 @@ protected: ...@@ -75,8 +40,7 @@ protected:
int main() int main()
{ {
MyApp myapp(WID, HEIG); MyApp myapp(WID, HEIG);
cout<<"second step\n"; myapp.event_loop(myapp.chessboard);
myapp.event_loop();
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment