package anabalica.github.io.meowletters.metrics;

/**
 * Score class keeps the current user score. User starts from score 0 and keeps
 * gaining more for each correct move. There is no top limit.
 *
 * @author Ana Balica
 */
public class Score {
}

@@ -239,10 +239,1157 @@
 Score %7B%0A
+    int points;%0A%0A    public Score() %7B%0A        points = 0;%0A    %7D%0A%0A    public Score(int points) %7B%0A        setPoints(points);%0A    %7D%0A%0A    public void setPoints(int points) throws IllegalArgumentException %7B%0A        if (points %3C 0) %7B%0A            throw new IllegalArgumentException(%22Number of points must be a positive number%22);%0A        %7D%0A        this.points = points;%0A    %7D%0A%0A    public int getPoints() %7B%0A        return points;%0A    %7D%0A%0A    /**%0A     * Add points to the score.%0A     *%0A     * @param points int positive amount of points%0A     * @return int total points%0A     */%0A    public int addPoints(int points) %7B%0A        if (points %3E 0) %7B%0A            this.points += points;%0A        %7D%0A        return this.points;%0A    %7D%0A%0A    /**%0A     * Update the score according to the size of the letter chain.%0A     *%0A     * @param chainSize int size of letter chain%0A     * @return int total points%0A     */%0A    public int update(int chainSize) %7B%0A        if (chainSize %3E 1) %7B%0A            points += (chainSize - 1) * 5;%0A        %7D%0A        return points;%0A    %7D%0A%0A    /**%0A     * Reset the score.%0A     */%0A    public Score reset() %7B%0A        points = 0;%0A        return this;%0A    %7D%0A
 %7D%0A

implement Score class