package com.srbenoit.filter.items;

/**
 * A point within an image that stores the point position, the velocity of the point, and the
 * velocity of the ambient surroundings of the point.
 */
public class ImagePoint {

    /** the X coordinate of the point position */
    private final int xPos;

    /** the Y coordinate of the point position */
    private final int yPos;

    /** the X component of the point velocity */
    private int xVel;

    /** the Y component of the point velocity */
    private int yVel;

    /** the X component of the ambient velocity near the point */
    private int xAmbientVel;

    /** the Y component of the ambient velocity near the point */
    private int yAmbientVel;

    /**
     * Constructs a new <code>ImagePoint</code> with zero velocities.
     *
     * @param  xCoord  the X coordinate of the point position
     * @param  yCoord  the Y coordinate of the point position
     */
    public ImagePoint(final int xCoord, final int yCoord) {

        this.xPos = xCoord;
        this.yPos = yCoord;
        this.xVel = 0;
        this.yVel = 0;
        this.xAmbientVel = 0;
        this.yAmbientVel = 0;
    }

    /**
     * Constructs a new <code>ImagePoint</code>.
     *
     * @param  xCoord            the X coordinate of the point position
     * @param  yCoord            the Y coordinate of the point position
     * @param  xVelocity         the X component of the point velocity
     * @param  yVelocity         the Y component of the point velocity
     * @param  xAmbientVelocity  the X component of the ambient velocity near the point
     * @param  yAmbientVelocity  the Y component of the ambient velocity near the point
     */
    public ImagePoint(final int xCoord, final int yCoord, final int xVelocity, final int yVelocity,
        final int xAmbientVelocity, final int yAmbientVelocity) {

        this.xPos = xCoord;
        this.yPos = yCoord;
        this.xVel = xVelocity;
        this.yVel = yVelocity;
        this.xAmbientVel = xAmbientVelocity;
        this.yAmbientVel = yAmbientVelocity;
    }

    /**
     * Gets the X coordinate of the point position.
     *
     * @return  the X coordinate
     */
    public int getXPos() {

        return this.xPos;
    }

    /**
     * Gets the Y coordinate of the point position.
     *
     * @return  the Y coordinate
     */
    public int getYPos() {

        return this.yPos;
    }

    /**
     * Gets the X component of the point velocity.
     *
     * @return  the X component
     */
    public int getXVel() {

        return this.xVel;
    }

    /**
     * Gets the Y component of the point velocity.
     *
     * @return  the Y component
     */
    public int getYVel() {

        return this.yVel;
    }

    /**
     * Gets the X component of the ambient velocity near the point.
     *
     * @return  the X component
     */
    public int getXAmbientVel() {

        return this.xAmbientVel;
    }

    /**
     * Gets the Y component of the ambient velocity near the point.
     *
     * @return  the Y component
     */
    public int getYAmbientVel() {

        return this.yAmbientVel;
    }

    /**
     * Sets the new velocity of the point
     *
     * @param  newXVel  the X component of the velocity
     * @param  newYVel  the Y component of the velocity
     */
    public void setVel(final int newXVel, final int newYVel) {

        this.xVel = newXVel;
        this.yVel = newYVel;
    }

    /**
     * Sets the new ambient velocity of the point
     *
     * @param  newXVel  the X component of the velocity
     * @param  newYVel  the Y component of the velocity
     */
    public void setAmbientVel(final int newXVel, final int newYVel) {

        this.xAmbientVel = newXVel;
        this.yAmbientVel = newYVel;
    }
}
