diff options
| author | fatpigsarefat <fatpigsarefat@outlook.com> | 2018-04-15 20:03:06 +0100 |
|---|---|---|
| committer | fatpigsarefat <fatpigsarefat@outlook.com> | 2018-04-15 20:04:38 +0100 |
| commit | fa91b320cb5ddbd19ac54b8504834270feb0f75a (patch) | |
| tree | 6743345f191edfd14b371970de589c2cb3552656 /src/me/fatpigsarefat/quests/player/questprogressfile/QuestProgress.java | |
| parent | 2361783c0982de3a8fd02fd96d10f5362af8b983 (diff) | |
Initial commit
Diffstat (limited to 'src/me/fatpigsarefat/quests/player/questprogressfile/QuestProgress.java')
| -rw-r--r-- | src/me/fatpigsarefat/quests/player/questprogressfile/QuestProgress.java | 96 |
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; + } +} |
