//ShapeBase.java

/**
 * Abstract base class for drawing simple shapes on the screen
 * using keyboard characters. 
*/
public abstract class ShapeBase implements ShapeInterface
{
    private int offset;

    public ShapeBase()
    {
        offset = 0;
    }

    public ShapeBase(int theOffset)
    {
        offset = theOffset;
    }

    /**
     * Draws the shape at the current line.
     */
    public abstract void drawHere();

    /**
     * Draws the shape at lineNumber lines down from the
     * current line. If this is interpreted to mean that
     * the first character of the figure is to be on the
     * line lineNumber lines down from the current line,
     * then we have to skip lineNumber - 1 lines.
     */
    public void drawAt
    (
        int lineNumber
    )
    {
        for (int count = 0; count < lineNumber - 1; count++)
            System.out.println();
        drawHere();
    }

    public void setOffset
    (
        int newOffset
    )
    {
        offset = newOffset;
    }


    public int getOffset()
    {
        return offset;
    }
}
