1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-02 15:33:30 +01:00
Jobs/com/gamingmesh/jobs/container/PlayerPoints.java

54 lines
985 B
Java
Raw Normal View History

2016-03-30 15:42:36 +02:00
package com.gamingmesh.jobs.container;
public class PlayerPoints {
double current = 0D;
double total = 0D;
boolean newEntry = false;
public PlayerPoints() {
newEntry = true;
}
public PlayerPoints(double points, double total) {
if (points == 0D && total == 0D)
newEntry = true;
this.current = points;
this.total = total;
}
public void addPoints(double points) {
this.current += points;
this.total += points;
}
public void setPoints(double points) {
this.current = points;
this.total = points;
}
public void takePoints(double points) {
this.current -= points;
}
public boolean havePoints(double points) {
return this.current >= points;
}
public double getCurrentPoints() {
return current;
}
public double getTotalPoints() {
return total;
}
public boolean isNewEntry() {
return newEntry;
}
public void setNewEntry(boolean state) {
newEntry = state;
}
}