import java.awt.Graphics;

/**
 * This class implements a Circle, which is defined by a radius and a center.
 *
 * @author fpereira
 *
 */
public class Circle implements Shape {

  /**
   * The radius of the circle.
   */
  private int r = 0;

  /**
   * The X coordinate of the middle point.
   */
  private int x = 0;

  /**
   * The Y coordinate of the middle point.
   */
  private int y = 0;

  /**
   * Constructor.
   *
   * @param xp
   *        The X coordinate of the center.
   * @param yp
   *        The Y coordinate of the center.
   * @param rp
   *        The radius.
   */
  public Circle(final int xp, final int yp, final int rp) {
    this.r = rp;
    this.x = xp;
    this.y = yp;
  }

  /**
   * Draws the circle in the graphic object.
   * @param g the object responsible for renderizing the draw on the screen.
   */
  public final void draw(final Graphics g) {
    int xuc = x - r;
    int yuc = y - r;
    g.drawOval(xuc, yuc, 2 * r, 2 * r);
  }
}
