aboutsummaryrefslogtreecommitdiffstats
path: root/src/me/fatpigsarefat/quests/player/questprogressfile/QuestProgress.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/me/fatpigsarefat/quests/player/questprogressfile/QuestProgress.java')
-rw-r--r--src/me/fatpigsarefat/quests/player/questprogressfile/QuestProgress.java96
1 files changed, 96 insertions, 0 deletions
diff --git a/src/me/fatpigsarefat/quests/player/questprogressfile/QuestProgress.java b/src/me/fatpigsarefat/quests/player/questprogressfile/QuestProgress.java
new file mode 100644
index 00000000..c4fe87b2
--- /dev/null
+++ b/src/me/fatpigsarefat/quests/player/questprogressfile/QuestProgress.java
@@ -0,0 +1,96 @@
+package me.fatpigsarefat.quests.player.questprogressfile;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+public class QuestProgress {
+
+ private List<TaskProgress> taskProgress = new ArrayList<>();
+ 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 setStarted(boolean started) {
+ this.started = started;
+ this.modified = true;
+ }
+
+ public boolean isStarted() {
+ return started;
+ }
+
+ public void setCompleted(boolean completed) {
+ this.completed = completed;
+ 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.add(taskProgress);
+ }
+
+ public List<TaskProgress> getTaskProgress() {
+ return taskProgress;
+ }
+
+ public TaskProgress getTaskProgress(String taskId) {
+ for (TaskProgress taskProgress : this.taskProgress) {
+ if (taskProgress.getTaskId().equals(taskId)) {
+ return taskProgress;
+ }
+ }
+ return null;
+ }
+
+ public boolean isWorthSaving() {
+ return modified;
+ }
+}