summaryrefslogtreecommitdiff
path: root/resources/js/classes/Area.js
diff options
context:
space:
mode:
Diffstat (limited to 'resources/js/classes/Area.js')
-rw-r--r--resources/js/classes/Area.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/resources/js/classes/Area.js b/resources/js/classes/Area.js
index f518f22..5a3a062 100644
--- a/resources/js/classes/Area.js
+++ b/resources/js/classes/Area.js
@@ -3,7 +3,6 @@ class Area {
monsterProgress = 0;
trainerProgress = 0;
- isCompleted = false;
constructor (slug) {
this.slug = slug;
@@ -15,14 +14,25 @@ class Area {
return translate(this.alternateSlug) || slugToName(this.slug);
}
+ get isCompleted () {
+ return this.monsterProgress >= this.requiredEncounters && this.trainerProgress >= this.trainers.length;
+ }
+
get alternateSlug () {
return DB.areas[this.slug]['modules/tuxemon.slug'];
}
+ /**
+ * @returns {Object[]}
+ */
get encounters () {
return DB.areas[this.slug].encounters;
}
+ get encounterPercentTotal () {
+ return DB.areas[this.slug].encounter_percent_total;
+ }
+
get requiredEncounters () {
return DB.areas[this.slug].requiredEncounters;
}