diff options
Diffstat (limited to 'src/me/fatpigsarefat/quests/player/questprogressfile/QuestProgress.java')
| -rw-r--r-- | src/me/fatpigsarefat/quests/player/questprogressfile/QuestProgress.java | 106 |
1 files changed, 0 insertions, 106 deletions
diff --git a/src/me/fatpigsarefat/quests/player/questprogressfile/QuestProgress.java b/src/me/fatpigsarefat/quests/player/questprogressfile/QuestProgress.java deleted file mode 100644 index 97e0b517..00000000 --- a/src/me/fatpigsarefat/quests/player/questprogressfile/QuestProgress.java +++ /dev/null @@ -1,106 +0,0 @@ -package me.fatpigsarefat.quests.player.questprogressfile; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -public class QuestProgress { - - private Map<String, TaskProgress> taskProgress = new HashMap<>(); - private String questid; - private boolean started; - private boolean completed; - private boolean completedBefore; - private long completionDate; - private UUID player; - private boolean modified; - - public QuestProgress(String questid, boolean completed, boolean completedBefore, long completionDate, UUID player, boolean started) { - this.questid = questid; - this.completed = completed; - this.completedBefore = completedBefore; - this.completionDate = completionDate; - this.player = player; - this.started = started; - } - - public QuestProgress(String questid, boolean completed, boolean completedBefore, long completionDate, UUID player, boolean started, boolean modified) { - this(questid, completed, completedBefore, completionDate, player, started); - this.modified = modified; - } - - public String getQuestId() { - return questid; - } - - public boolean isCompleted() { - return completed; - } - - public void setCompleted(boolean completed) { - this.completed = completed; - this.modified = true; - } - - public boolean isStarted() { - return started; - } - - public void setStarted(boolean started) { - this.started = started; - this.modified = true; - } - - public long getCompletionDate() { - return completionDate; - } - - public void setCompletionDate(long completionDate) { - this.completionDate = completionDate; - this.modified = true; - } - - public UUID getPlayer() { - return player; - } - - public boolean isCompletedBefore() { - return completedBefore; - } - - public void setCompletedBefore(boolean completedBefore) { - this.completedBefore = completedBefore; - this.modified = true; - } - - public void addTaskProgress(TaskProgress taskProgress) { - this.taskProgress.put(taskProgress.getTaskId(), taskProgress); - } - - public Collection<TaskProgress> getTaskProgress() { - return taskProgress.values(); - } - - public TaskProgress getTaskProgress(String taskId) { - TaskProgress tP = taskProgress.getOrDefault(taskId, null); - if (tP == null) { - repairTaskProgress(taskId); - tP = taskProgress.getOrDefault(taskId, null); - } - return tP; - } - - public void repairTaskProgress(String taskid) { - TaskProgress taskProgress = new TaskProgress(taskid, null, player, false); - this.addTaskProgress(taskProgress); - } - - public boolean isWorthSaving() { - return modified; - } - - public void setWorthSaving(boolean modified) { - this.modified = modified; - } -} |
