1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 22:13:25 +01:00
Jobs/com/gamingmesh/jobs/economy/PointsData.java
2016-03-30 16:42:36 +03:00

44 lines
1016 B
Java

package com.gamingmesh.jobs.economy;
import java.util.HashMap;
import java.util.UUID;
import com.gamingmesh.jobs.container.PlayerPoints;
public class PointsData {
HashMap<UUID, PlayerPoints> Pointbase = new HashMap<UUID, PlayerPoints>();
public PointsData() {
}
public HashMap<UUID, PlayerPoints> getPointBase() {
return Pointbase;
}
public void addPlayer(UUID uuid) {
addPlayer(uuid, 0D);
}
public void addPlayer(UUID uuid, double points) {
addPlayer(uuid, points, 0D);
}
public void addPlayer(UUID uuid, double points, double total) {
if (!Pointbase.containsKey(uuid))
Pointbase.put(uuid, new PlayerPoints(points, total));
}
public void addPoints(UUID uuid, Double points) {
if (!Pointbase.containsKey(uuid))
addPlayer(uuid, points);
else {
Pointbase.get(uuid).addPoints(points);
}
}
public PlayerPoints getPlayerPointsInfo(UUID uuid) {
return Pointbase.containsKey(uuid) ? Pointbase.get(uuid) : new PlayerPoints();
}
}