import java.awt.Point;

public abstract class PointObject implements PointGenerator, Displaceable {
    /** dimension */
    private int r;
    
    /** center of star */
    private int x;

    /** center of star */
    private int y;

    /** list of points */
    protected Point[] plist;

    /** constructor */
    public PointObject(int r, int x, int y) {
        this.r = r;
        this.x = x;
        this.y = y;
        // plist left uninitialized
    }

    /** fulfill the PointGenerator contract */
    public Point[] getPointArray() {
        return plist;
    }

    /** accessor for x */
    public int getX() {return x;}

    /** accessor for y */
    public int getY() {return y;}

    /** move all points by given amount */
    public void move(int dx, int dy) {
        x += dx;
        y += dy;
        for (int i = 0; i < plist.length; i++) {
            plist[i].x += dx;
            plist[i].y += dy;
        }
    }
}
