summaryrefslogtreecommitdiff
path: root/canevas.cpp
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2023-01-16 03:26:28 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2023-01-16 03:26:28 -0500
commit20ae6ae3f82a4eeeb123d9c1f895f10c8967f44b (patch)
treeda18c55250fb9f544b5b67aacc1a3fab4a7ccf75 /canevas.cpp
parent267868847b0885f60aaae43afd4f54ce028181d8 (diff)
parent5f8fa959dab1106105f9e58325f65d0b51bb1631 (diff)
Merge branch 'development'
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;