// The Figure abstract class, for figures with location, fill char and depth
abstract class Figure implements Comparable {
    // Read itself from StdIn
    public void read(chapman.io.StdIn in) {
	System.out.print("  Depth? ");
	depth = in.readInt();
	System.out.print("  Fill character? ");
	fill_char = in.readChar();
	System.out.print("  x? ");
	x = in.readInt();
	System.out.print("  y? ");
	y = in.readInt();
    }
    // Check whether the figure contains (loc_x, loc_y)
    abstract boolean contains(int loc_x, int loc_y);
    // Get the fill character
    public char getFill() {
	return fill_char;
    }
    // Compare depths
    public int compareTo(Object obj) {
	Figure fig = (Figure) obj;
	return depth - fig.depth;
    }
    protected int x, y;
    private int depth;
    private char fill_char;
}
