_FindGeoRock method

This commit is contained in:
ReznoRMichael 2022-01-20 12:28:12 +01:00
parent 8032b74275
commit 232b8dacc9

View file

@ -2428,6 +2428,11 @@ function ResetCompletion(db) {
class DataChecker { 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) { constructor(saveFile) {
this.saveFile = saveFile; this.saveFile = saveFile;
this.playerData = saveFile.playerData; this.playerData = saveFile.playerData;
@ -2446,6 +2451,17 @@ class DataChecker {
return false; 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) { checkItems(section) {
this.section = section; this.section = section;
this.entries = section.entries; this.entries = section.entries;