-
-
Save parzibyte/0a4f8fa9dfd01090c0ae8cee0dbbecb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Celda | |
{ | |
private: | |
int x, y; | |
bool mina, descubierta; | |
public: | |
Celda(int x, int y, bool tieneMina) | |
{ | |
this->x = x; | |
this->y = y; | |
this->mina = tieneMina; | |
this->descubierta = false; | |
} | |
void imprimir() | |
{ | |
cout << "Celda en " << this->x << ", " << this->y << " con mina? " << this->mina << "\n"; | |
} | |
bool establecerMina(bool tieneMina) | |
{ | |
if (this->tieneMina()) | |
{ | |
return false; | |
} | |
else | |
{ | |
this->mina = tieneMina; | |
return true; | |
} | |
} | |
bool tieneMina() | |
{ | |
return this->mina; | |
} | |
bool estaDescubierta() | |
{ | |
return this->descubierta; | |
} | |
void setDescubierta(bool descubierta) | |
{ | |
this->descubierta = descubierta; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment