package com.publicuhc.scatter;

public class ScatterParameters {

    private Double m_radius = null;
    private Double m_playerRadius = null;
    private Integer m_maxAttempts = null;

    /**
     * @return the radius for the scatter
     * @throws java.lang.IllegalStateException if radius wasnt set, check if set with isRadiusSet
     */
    public double getRadius() {
        if(m_radius == null) {
            throw new IllegalStateException();
        }
        return m_radius;
    }

    /**
     * @return whether the radius has been set or not
     */
    public boolean isRadiusSet() {
        return m_radius != null;
    }

    /**
     * @param radius the radius to set the scatter for
     * @return this, for chaining
     */
    public ScatterParameters setRadius(double radius) {
        m_radius = radius;
        return this;
    }

    /**
     * @return the player radius for the scatter
     * @throws java.lang.IllegalStateException if player radius wasnt set, check if set with isPlayerRadiusSet
     */
    public double getPlayerRadius() {
        if(m_playerRadius == null) {
            throw new IllegalStateException();
        }
        return m_playerRadius;
    }

    /**
     * @return whether the player radius has been set or not
     */
    public boolean isPlayerRadiusSet() {
        return m_playerRadius != null;
    }

    /**
     * @param radius the player radius to set the scatter for
     * @return this, for chaining
     */
    public ScatterParameters setPlayerRadius(double radius) {
        m_playerRadius = radius;
        return this;
    }

    /**
     * @return the max attempts per location
     * @throws java.lang.IllegalStateException if wasnt set, check if set with isMaxAttemptsSet
     */
    public int getMaxAttempts() {
        if(m_maxAttempts == null) {
            throw new IllegalStateException();
        }
        return m_maxAttempts;
    }

    /**
     *
     * @return whether the max attempts has been set or not
     */
    public boolean isMaxAttemptsSet() {
        return m_maxAttempts != null;
    }

    /**
     * @param attempts the max attempts per location
     * @return this, for method chaining
     */
    public ScatterParameters setMaxAttempts(int attempts) {
        m_maxAttempts = attempts;
        return this;
    }
}

@@ -25,16 +25,45 @@
 atter;%0A%0A
+import org.bukkit.Location;%0A%0A
 public c
@@ -207,16 +207,54 @@
  = null;
+%0A    private Location m_centre = null;
 %0A%0A    /*
@@ -2380,11 +2380,515 @@
 s;%0A    %7D
+%0A%0A    /**%0A     * @return the centre if set, null otherwise%0A     */%0A    public Location getCentre() %7B%0A        return m_centre;%0A    %7D%0A%0A    /**%0A     * @param location the centre for the new scatter%0A     * @return this, for method chaining%0A     */%0A    public ScatterParameters setCentre(Location location) %7B%0A        m_centre = location;%0A        return this;%0A    %7D%0A%0A    /**%0A     * @return whether the centre has been set or not%0A     */%0A    public boolean isCentreSet() %7B%0A        return m_centre != null;%0A    %7D
 %0A%7D%0A

add the centre to the parameters