From 232b8dacc9b205040afcaea85d6dbe1546e2f210 Mon Sep 17 00:00:00 2001 From: ReznoRMichael Date: Thu, 20 Jan 2022 12:28:12 +0100 Subject: [PATCH] _FindGeoRock method --- src/js/HKCheckCompletion.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/js/HKCheckCompletion.js b/src/js/HKCheckCompletion.js index e7b3740..96e7b13 100644 --- a/src/js/HKCheckCompletion.js +++ b/src/js/HKCheckCompletion.js @@ -2428,6 +2428,11 @@ function ResetCompletion(db) { class DataChecker { + /** + * Used for checking and verifying data (like Grubs, Items or Geo Rocks) inside a player's save file. + * Pass a save to the object and it will be split automatically to playerData, boolData and geoRocksData. + * @param {object} saveFile The whole player's save file, in JSON format + */ constructor(saveFile) { this.saveFile = saveFile; this.playerData = saveFile.playerData; @@ -2446,6 +2451,17 @@ class DataChecker { return false; } + _FindGeoRock(id = "", sceneName = "") { + + for (let i = 0, length = this.geoRocksData.length; i < length; i++) { + if (this.geoRocksData[i].id === id && this.geoRocksData[i].sceneName === sceneName && this.geoRocksData[i].hitsLeft === 0) { + return true; + } + } + + return false; + } + checkItems(section) { this.section = section; this.entries = section.entries;