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

set_aura fuggveny valtoztatasa

parent 220f898c
No related branches found
No related tags found
No related merge requests found
......@@ -73,7 +73,7 @@ void Field::rajzol() const
if (_helytelen)
gout << color(255,0,0);
gout << font("LiberationSans-Regular.ttf",_szel/3);
gout << font("LiberationSans-Regular.ttf",(_mag/5)*3);
if (_ertek)
{
gout << move_to(_x+ (_szel-gout.twidth(std::to_string(_ertek)))/2,
......@@ -101,12 +101,7 @@ void Field::set_ertek(int uj)
_ertek=uj;
}
void Field::set_aura_true()
void Field::set_aura(bool be)
{
_aura=true;
}
void Field::set_aura_false()
{
_aura=false;
_aura=be;
}
......@@ -14,8 +14,7 @@ class Field : public Widget
virtual int get_ertek();
virtual void set_ertek(int);
virtual void set_aura_true();
virtual void set_aura_false();
virtual void set_aura(bool);
protected:
int _ertek;
......
......@@ -95,9 +95,17 @@ void GameMaster::save(int sorszam, int ertek)
save_fajlba();
}
bool GameMaster::szabalyos_e(int jelenlegi_ertek, set<int> ertekek)
bool GameMaster::szabalyos_e(int jelenlegi_ertek, set<int> aura_ertekek)
{
bool igen=true;
for (int ertek : aura_ertekek)
{
if (ertek == jelenlegi_ertek)
{
igen=false;;
}
}
return igen;
}
std::vector<int> GameMaster::get_feladat()
......
......@@ -37,11 +37,11 @@ int MyApp::action(std::string id, genv::event ev, int focus)
{
if (aura_halmaz.find(i) != aura_halmaz.end())
{
palya[i]->set_aura_true();
palya[i]->set_aura(true);
}
else
{
palya[i]->set_aura_false();
palya[i]->set_aura(false);
}
}
}
......@@ -84,11 +84,11 @@ int MyApp::action(std::string id, genv::event ev, int focus)
{
if (aura_halmaz.find(i) != aura_halmaz.end())
{
palya[i]->set_aura_true();
palya[i]->set_aura(true);
}
else
{
palya[i]->set_aura_false();
palya[i]->set_aura(false);
}
}
}
......@@ -96,14 +96,14 @@ int MyApp::action(std::string id, genv::event ev, int focus)
if (ev.keycode >= 49 && ev.keycode <= 57)
{
palya[focus]->set_ertek(ev.keycode-48);
_game->save(focus,palya[focus]->get_ertek());
}
if (ev.keycode==key_delete || ev.keycode==key_backspace)
{
palya[focus]->set_ertek(0);
_game->save(focus,palya[focus]->get_ertek());
}
_game->save(focus,palya[focus]->get_ertek());
}
if (id=="mouse")
......@@ -126,11 +126,11 @@ int MyApp::action(std::string id, genv::event ev, int focus)
{
if (aura_halmaz.find(i) != aura_halmaz.end())
{
palya[i]->set_aura_true();
palya[i]->set_aura(true);
}
else
{
palya[i]->set_aura_false();
palya[i]->set_aura(false);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment