From d0bde3c60fa911ac0bb0f71ce2a6a963c874392e Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Fri, 13 Jan 2023 14:52:41 -0500 Subject: Everything works before validation --- canevas.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'canevas.cpp') diff --git a/canevas.cpp b/canevas.cpp index 1010ea6..0c203fc 100644 --- a/canevas.cpp +++ b/canevas.cpp @@ -10,9 +10,9 @@ Canevas::Canevas() { Couche couches[MAX_COUCHES]; - for (int i = 0; i < MAX_COUCHES; i++) { - couches[i] = Couche(); - }; + /* for (int i = 0; i < MAX_COUCHES; i++) { */ + /* couches[i] = Couche(); */ + /* }; */ couches[0].changerEtat(STATE_ACTIVE); } @@ -70,9 +70,7 @@ bool Canevas::retirerForme(int index) { double Canevas::aire() { double aire = 0; for (int i = 0; i < MAX_COUCHES; i++) { - if (couches[i].getEtat() == STATE_ACTIVE) { aire += couches[i].aire(); - }; }; return aire; }; @@ -92,3 +90,10 @@ void Canevas::afficher(ostream & s) { couches[i].afficher(s); }; }; + +bool Canevas::reinitialiserCouche(int index) { + if (index < 0 || index >= MAX_COUCHES){ + return false; + }; + return couches[index].reinitialiser(); +}; -- cgit v1.2.3