Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pl.knugi;
- public class Score {
- private int points;
- private int boost;
- public Score(){
- this.points = 0;
- this.boost = 1;
- }
- public void addPoint(){
- this.points+=this.boost;
- }
- public void setBoost(){
- this.boost++;
- }
- public void setBoost(int boost){
- this.boost=boost;
- }
- public int getPoints() {
- return this.points;
- }
- public int getBoost() {
- return this.boost;
- }
- public int getCost(){
- int ret = 10 + ((this.boost - 1) * 2);
- // an = a1 + (n-1)r
- // a1 = 10
- // r = 1
- return ret;
- }
- public void removePoints(int points){
- this.points-=points;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment