package stack;

import shape.Circle;
import shape.Square;

public class TestShapeStack {
	
	public static void testShapeStack(ShapeStack stack) {
		System.out.println("Est vide ? : " + stack.isEmpty());
		stack.push(new Circle());
		System.out.println("Est vide ? : " + stack.isEmpty());
		System.out.println("Sommet : " + stack.peek());
		stack.push(new Square());
		System.out.println("Sommet : " + stack.peek());
		stack.push(new Circle());
		System.out.println("Sommet : " + stack.peek());
		stack.push(new Square());
		System.out.println("Sommet : " + stack.peek());
		stack.pop();
		System.out.println("Sommet : " + stack.peek());
		stack.pop();
		System.out.println("Sommet : " + stack.peek());
		stack.pop();
		System.out.println("Est vide ? : " + stack.isEmpty());
	}
	
	public static void main(String[] args) {
		System.out.println("Pile de formes avec tableau de taille fixe");
		testShapeStack(new ShapeStackFixedSizeArray(3));
		System.out.println("Pile de formes avec tableau extensible");
		testShapeStack(new ShapeStackExtensibleArray());
	}
}
