import acm.program.*;
import acm.graphics.*;
import java.awt.*;

class Body extends GOval {
    private String name;
    
    public Body(double inX, double inY, double inMass, String inName,
            double inVx, double inVy) {
        super(inX - 10, inY - 10, 20, 20);
        name = inName;
    }

    // Modifies getX so it returns x-coordinate of the oval's center
    public double getX() {
        return super.getX() + this.getWidth() / 2;
    }

    // Modifies getY so it returns y-coordinate of the oval's center
    public double getY() {
        return super.getY() + this.getHeight() / 2;
    }

    // We also modify paint. You won't need to use this method directly, but
    // the GraphicsProgram uses it to draw its contents. GOval defines a
    // paint method, but it depends on getX and getY returning relative to
    // the oval's top left corner.
    public void paint(Graphics g) {
        g.setColor(this.getFillColor());
        g.fillOval((int) this.getX() - 10, (int) this.getY() - 10, 20, 20);
        g.setColor(Color.BLACK);
        g.drawOval((int) this.getX() - 10, (int) this.getY() - 10, 20, 20);
    }
    
    // Returns this body's name. You don't need to use this, though you
    // might end up using it for debugging purposes.
    public String toString() {
        return name;
    }
}
