knugi

Untitled

Apr 12th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. package pl.knugi;
  2.  
  3. public class Score {
  4. private int points;
  5. private int boost;
  6.  
  7. public Score(){
  8. this.points = 0;
  9. this.boost = 1;
  10. }
  11. public void addPoint(){
  12.  
  13. this.points+=this.boost;
  14. }
  15. public void setBoost(){
  16. this.boost++;
  17. }
  18. public void setBoost(int boost){
  19. this.boost=boost;
  20. }
  21. public int getPoints() {
  22. return this.points;
  23. }
  24. public int getBoost() {
  25. return this.boost;
  26. }
  27. public int getCost(){
  28. int ret = 10 + ((this.boost - 1) * 2);
  29. // an = a1 + (n-1)r
  30. // a1 = 10
  31. // r = 1
  32. return ret;
  33. }
  34. public void removePoints(int points){
  35. this.points-=points;
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment