diff options
Diffstat (limited to 'canevas.cpp')
-rw-r--r-- | canevas.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/canevas.cpp b/canevas.cpp index 959e681..edcb8be 100644 --- a/canevas.cpp +++ b/canevas.cpp @@ -10,7 +10,7 @@ Canevas::Canevas() { Couche couches[MAX_COUCHES]; - couches[0].changerEtat(STATE_ACTIVE); + activerCouche(0); } Canevas::~Canevas() { @@ -37,13 +37,6 @@ bool Canevas::activerCouche(int index) { return couches[index].changerEtat(STATE_ACTIVE); }; -bool Canevas::cacherCouche(int index) { - if (index < 0 || index >= MAX_COUCHES) - return false; - couches[index].changerEtat(STATE_INACTIVE); - return true; -}; - bool Canevas::ajouterForme(Forme *p_forme) { int active = -1; for (int i = 0; i < MAX_COUCHES; i++) @@ -88,6 +81,15 @@ void Canevas::afficher(ostream & s) { }; }; +void Canevas::getEtats(ostream &s) { + s << "[ "; + for (int i = 0; i < MAX_COUCHES; i++) { + s << STATES[couches[i].getEtat()]; + if (i < MAX_COUCHES - 1) s << ", "; + else s << " ]\n"; + }; +} + bool Canevas::reinitialiserCouche(int index) { if (index < 0 || index >= MAX_COUCHES){ return false; |