Skip to content
Snippets Groups Projects
Commit ec7f7534 authored by Monoki Dorina's avatar Monoki Dorina
Browse files

uj szinek

parent 95f24285
Branches
No related tags found
No related merge requests found
......@@ -3,44 +3,89 @@
using namespace genv;
Field::Field(Application* parent, int x, int y, int meret, int ertek):
Widget(parent, x, y, meret, meret), _ertek(ertek)
Field::Field(Application* parent, int x, int y, int meret, int index, int ertek):
Widget(parent, x, y, meret, meret), _index(index), _ertek(ertek)
{
_fix=_ertek;
_aura=false;
}
void Field::rajzol() const
{
if (_kijelolt) //keret
gout << color(light_purple);
/// keret
if (_kijelolt)
{
if (_fix)
gout << color(light_grey);
else
gout << color(light_purple);
}
else
gout << color(dark_purple);
{
if (_fix)
gout << color(dark_grey);
else
gout << color(dark_purple);
}
gout << move_to(_x,_y) << box(_szel,_mag);
if (_kijelolt) //hatter
/// hatter
if (_kijelolt)
{
if (_fix)
gout << color(white);
gout << color(dark_grey);
else
gout << color(dark_purple);
}
else if (_aura)
{
if (_fix)
gout << color(mid_grey);
else
gout << color(mid_purple);
}
else
gout << color(bg_purple);
{
if (_fix)
gout << color(light_grey);
else
gout << color(light_purple);
}
gout << move_to(_x+1,_y+1) << box(_szel-2,_mag-2);
if (_kijelolt) //szoveg
/// vonalak
if (_kijelolt)
{
if (_fix)
gout << color(light_grey);
else
gout << color(light_purple);
}
else
{
if (_fix)
gout << color(dark_grey);
else
gout << color(dark_purple);
}
if ((_index%9) % 3 ==0) // bal
gout << move_to(_x+1,_y) << line(0,_mag);
if ((_index%9) % 3 ==2) //jobb
gout << move_to(_x+_szel-2,_y) << line(0,_mag);
/// szoveg
if (_kijelolt)
{
if (_fix)
gout << color(black);
gout << color(light_grey);
else
gout << color(light_purple);
}
else
{
if (_fix)
gout << color(black);
gout << color(dark_grey);
else
gout << color(dark_purple);
}
......
......@@ -7,7 +7,7 @@
class Field : public Widget
{
public:
Field(Application* parent, int x, int y, int meret, int ertek);
Field(Application* parent, int x, int y, int meret, int index, int ertek);
virtual void rajzol() const override;
virtual void kezel(genv::event) override;
......@@ -16,6 +16,8 @@ class Field : public Widget
protected:
int _ertek;
bool _fix;
bool _aura;
int _index;
};
......
......@@ -20,7 +20,7 @@ class MyApp : public Application
{
for (int i=0; i<9; i++)
{
Field *f = new Field(this,i*78,j*78,78,game_kezdo[9*j+i]);
Field *f = new Field(this,i*78,j*78,78,9*j+i,game_kezdo[9*j+i]);
palya.push_back(f);
}
}
......
9 8 5 6 0 1 0 0 0 0 0 6 5 4 0 0 2 1 0 0 0 0 3 0 0 0 0 8 0 7 9 0 4 1 0 0 5 3 0 0 0 7 9 8 6 1 9 0 8 0 0 0 0 0 0 0 3 0 7 0 6 0 0 0 2 0 0 8 5 3 0 0 7 0 8 3 0 6 0 0 0
......@@ -4,11 +4,18 @@
#include "graphics.hpp"
#include "application.hpp"
#define dark_purple 130,37,184
/*#define dark_purple 130,37,184
#define light_purple 210,145,255
#define bg_purple 246,232,255
#define white 255,255,255
#define black 0,0,0
#define black 0,0,0*/
#define dark_purple 56,0,102
#define mid_purple 133,133,255
#define light_purple 204,204,255
#define dark_grey 51,51,51
#define mid_grey 191,191,191
#define light_grey 230,230,230
class Widget
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment