diff --git a/gammadraw.cpp b/gammadraw.cpp index 52e2419..819c2b4 100644 --- a/gammadraw.cpp +++ b/gammadraw.cpp @@ -34,15 +34,32 @@ gammadraw::gammadraw(string szin, string szam, gammamester* logika) this->y=1; this->logika = logika; meret = stoi(szam); + this->vege = false; } void gammadraw::draw() { + this->negyzetracsrajzolo(); this->lepesrajzolo(); + cout<<"nincs vege"; +if(vege) + { + cout<<"vege"; + gout<logika->nyertesszin); + + } + + } void gammadraw::negyzetracsrajzolo() { + vege = this->logika->win; + for(int j=0; jnegyzetmeret)<negyzetmeret,this->negyzetmeret); gout<negyzetmeret+2)<negyzetmeret-3, this->negyzetmeret-3); + } } } diff --git a/gammadraw.hpp b/gammadraw.hpp index 0678fd6..8a236bb 100644 --- a/gammadraw.hpp +++ b/gammadraw.hpp @@ -27,5 +27,6 @@ class gammadraw : public Widget std::string szamlalo; int negyzetmeret; bool focus = false; + bool vege = false; }; #endif // NUMERIC_HPP_INCLUDED diff --git a/gammamester.cpp b/gammamester.cpp index 518d523..926070a 100644 --- a/gammamester.cpp +++ b/gammamester.cpp @@ -92,11 +92,11 @@ bool gammamester::gameover() this->win = true; if(adat[i].kor) { - nyertesszin = "haromszog"; + this->nyertesszin = "haromszog jelu jatekos"; } else { - nyertesszin = "x"; + this->nyertesszin = "x jelu jatekos"; } } } diff --git a/gammamester.hpp b/gammamester.hpp index d7aae7d..268a0c3 100644 --- a/gammamester.hpp +++ b/gammamester.hpp @@ -16,6 +16,7 @@ class gammamester int hanykellnyerni; std::vector mostani_allas(); std::vector adat; + std::string nyertesszin; bool win = false; int fugg; int viz; diff --git a/main.cpp b/main.cpp index 9b0c0f5..1249157 100644 --- a/main.cpp +++ b/main.cpp @@ -69,7 +69,7 @@ int main() gout<240 && ev.pos_x<360 && ev.pos_y>100 && ev.pos_y<120 && ev.button == btn_left) + if(ev.pos_x>240 && ev.pos_x<360 && ev.pos_y>100 && ev.pos_y<120 && ev.buttot) { logika = new gammamester(); //game logic started mehet = true;