package visitor;

public class Driver {
	public static void main(String[] args) {
		CompositeItem t = new CompositeItem("Treasure", "A box of jewels");
		t.addItem(new Diamond("A glittering diamond"));
		CompositeItem c1 = new CompositeItem("Necklace", "The princess's necklace");
		c1.addItem(new Chain("Chain of gold"));
		c1.addItem(new Ruby("The Tear of Blood"));
		t.addItem(c1);
		t.addItem(new Diamond("The Sparkling Star"));
		Visitor v1 = new DescriptiveVisitor();
		ComputeValueVisitor v2 = new ComputeValueVisitor();
		LowestHPVisitor v3 = new LowestHPVisitor();
		t.accept(v1);
		t.accept(v2);
		t.accept(v3);
		System.out.println("Value = " + v2.getValue());
		System.out.println("Lowest HP = " + v3.getLowestHP());
	}
}
