Add method to the Image class.
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 14 Feb 2018 11:24:17 +0000 (12:24 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 14 Feb 2018 11:24:17 +0000 (12:24 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
TP2/Image.java

index 807e11b2aec81d9a3ed836c6fb548fe468209604..ac668701251bdaeb6ea94f7eea76aacee2897e11 100644 (file)
@@ -38,7 +38,13 @@ class Image extends Forme {
     }
 
     public boolean ajouter(Forme forme) {
-        return false;
+        boolean rtVal = false;
+        if (!isFull()) {
+            formeCollection[formeNumber] = forme;
+            formeNumber = 0;
+            rtVal = true;
+        }
+        return rtVal;
     }
 
 }