import java.awt.Color;
import java.awt.geom.GeneralPath;
import becker.robots.*;
import becker.robots.icons.*;

/**
 * This class supports the <a href=
 * "http://darcy.rsgc.on.ca/ACES/ICS2O/1011RobotProgrammingProjects.htm#HanselandGretel">Hansel
 * & Gretel</a> project and should not be modified. However, students are
 * encouraged to examine the code to learn how they might create their own
 * CompositeIcon objects.
 * 
 * @author C. D'Arcy
 * 
 */
public class House extends Thing {

	public House(City c, int s, int a) {
		super(c, s, a);
		Color darkGreen = new Color(0, 0x66, 0);
		Color brown = new Color(0xCC, 0x99, 0x66);

		Icon[] icons = { new ShapeIcon(House.base, brown, 0.6),
				new ShapeIcon(House.roof, darkGreen, 0.8) };
		this.setIcon(new CompositeIcon(icons));
	}

	// provide a crude rendering of a roof
	private static GeneralPath roof;
	static {
		roof = new GeneralPath();
		roof.moveTo(0.0F, 0.4F);
		roof.lineTo(1.0F, 0.4F);
		roof.lineTo(0.5F, 0.0F);
		roof.closePath();

	}

	// provide a crude rendering of the base of the house
	private static GeneralPath base;
	static {
		base = new GeneralPath();
		base.moveTo(0.1F, 0.3F);
		base.lineTo(0.9F, 0.3F);
		base.lineTo(0.9F, 1.0F);
		base.lineTo(0.1F, 1.0F);
		base.closePath();

	}

}
