exo4: add ClassPreamble class annotation.
[Project_POO.git] / exo4 / Piletransformations.java
diff --git a/exo4/Piletransformations.java b/exo4/Piletransformations.java
deleted file mode 100644 (file)
index 5e53ddd..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-
-class Piletransformations {
-    private Point[] transformations;
-    private int currentTransformation;
-
-    Piletransformations(int size) {
-        transformations = new Point[size];
-        for (int i = 0; i < transformations.length; i++) {
-            transformations[i] = new Point(0, 0);
-        }
-        currentTransformation = 0;
-    }
-
-    public Point getCurrentTransformation() {
-        if (isEmpty()) {
-            return transformations[currentTransformation];
-        } else {
-            return transformations[currentTransformation - 1];
-        }
-    }
-
-    private boolean isEmpty() {
-        return (currentTransformation == 0);
-    }
-
-    private boolean isFull() {
-        return (currentTransformation >= transformations.length);
-    }
-
-    public boolean empiler(Point p) {
-        boolean rtVal = false;
-        if (isEmpty()) {
-            transformations[currentTransformation] = p;
-            currentTransformation++;
-            rtVal = true;
-        } else if (!isFull()) {
-            transformations[currentTransformation] = transformations[currentTransformation - 1].additionner(p);
-            currentTransformation++;
-            rtVal = true;
-        }
-        return rtVal;
-    }
-
-    public Point depiler() {
-        if(!isEmpty()) {
-            currentTransformation--;
-            return transformations[currentTransformation];
-        } else {
-            return transformations[currentTransformation];
-        }
-    }
-
-    public void display() {
-        System.out.println("----");
-        for (int i = 0; i < currentTransformation; i++) {
-            System.out.println(transformations[i].toString());
-        }
-    }
-
-}