mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-24 14:51:46 -05:00
clean up/fix mq dungeon and required trial parsing logic (#4979)
This commit is contained in:
parent
b62808dc2d
commit
f4604673e0
@ -1419,17 +1419,16 @@ std::array<DungeonInfo*, 12> Dungeons::GetDungeonList() {
|
|||||||
size_t Dungeons::GetDungeonListSize() const {
|
size_t Dungeons::GetDungeonListSize() const {
|
||||||
return dungeonList.size();
|
return dungeonList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dungeons::ParseJson(nlohmann::json spoilerFileJson) {
|
void Dungeons::ParseJson(nlohmann::json spoilerFileJson) {
|
||||||
nlohmann::json mqDungeonsJson = spoilerFileJson["masterQuestDungeons"];
|
nlohmann::json mqDungeonsJson = spoilerFileJson["masterQuestDungeons"];
|
||||||
for (auto it = mqDungeonsJson.begin(); it != mqDungeonsJson.end(); ++it) {
|
|
||||||
std::string dungeonName = it.value().get<std::string>();
|
for (auto& dungeon : dungeonList) {
|
||||||
for (auto& dungeon : dungeonList) {
|
dungeon.ClearMQ();
|
||||||
if (dungeon.GetName() == dungeonName) {
|
|
||||||
dungeon.SetMQ();
|
if (std::find(mqDungeonsJson.begin(), mqDungeonsJson.end(), dungeon.GetName()) != mqDungeonsJson.end()) {
|
||||||
} else {
|
dungeon.SetMQ();
|
||||||
dungeon.ClearMQ();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // namespace Rando
|
} // namespace Rando
|
||||||
|
@ -71,13 +71,13 @@ size_t Trials::GetTrialListSize() const {
|
|||||||
|
|
||||||
void Trials::ParseJson(nlohmann::json spoilerFileJson) {
|
void Trials::ParseJson(nlohmann::json spoilerFileJson) {
|
||||||
nlohmann::json trialsJson = spoilerFileJson["requiredTrials"];
|
nlohmann::json trialsJson = spoilerFileJson["requiredTrials"];
|
||||||
for (auto it = trialsJson.begin(); it != trialsJson.end(); ++it) {
|
|
||||||
std::string trialName = it.value().get<std::string>();
|
for (auto& trial : mTrials) {
|
||||||
for (auto& trial : mTrials) {
|
trial.SetAsSkipped();
|
||||||
if (trial.GetName() == trialName) {
|
|
||||||
|
for (auto nameInLang : trial.GetName().GetAllMessages()) {
|
||||||
|
if (std::find(trialsJson.begin(), trialsJson.end(), nameInLang) != trialsJson.end()) {
|
||||||
trial.SetAsRequired();
|
trial.SetAsRequired();
|
||||||
} else {
|
|
||||||
trial.SetAsSkipped();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -91,4 +91,4 @@ std::unordered_map<uint32_t, RandomizerHintTextKey> Trials::GetAllTrialHintHeys(
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Rando
|
} // namespace Rando
|
||||||
|
Loading…
x
Reference in New Issue
Block a user