summaryrefslogtreecommitdiff
path: root/canevas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'canevas.cpp')
-rw-r--r--canevas.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/canevas.cpp b/canevas.cpp
index 0c203fc..edcb8be 100644
--- a/canevas.cpp
+++ b/canevas.cpp
@@ -10,10 +10,7 @@
Canevas::Canevas() {
Couche couches[MAX_COUCHES];
- /* for (int i = 0; i < MAX_COUCHES; i++) { */
- /* couches[i] = Couche(); */
- /* }; */
- couches[0].changerEtat(STATE_ACTIVE);
+ activerCouche(0);
}
Canevas::~Canevas() {
@@ -40,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++)
@@ -91,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;