/**
 * A Calaveras Crossing obstacle.  Obstacles include vehicles, logs,
 * and turtles.  Otters, snakes, and other frogs are not obstacles.
 *
 * @author Jim Glenn
 * @version 0.1 10/7/2008
 */

public class Obstacle
{
    /**
     * The width of this obstacle, measured in frog widths.
     */

    private double width;

    /**
     * Creates a new obstacle of the given width.
     *
     * @param w a positive <CODE>double</CODE>
     */

    public Obstacle(double w)
    {
	if (w <= 0.0)
	    throw new IllegalArgumentException("Width must be positive:" + w);

	width = w;
    }

    /**
     * Returns the width of this obstacle.
     *
     * @return the width of this obstacle
     */

    public double getWidth()
    {
	return width;
    }

    /**
     * Updates this obstacle.  The default implementation does nothing.
     *
     * @param t the time sine the last update, in seconds
     */

    public void update(double t)
    {
    }

    /**
     * Determines if this obstacle is lethal to the touch.
     */

    public boolean isLethal()
    {
	return false;
    }
}

