order wild encounter json reading

This commit is contained in:
garak
2021-08-12 19:19:21 -04:00
parent a997fb69da
commit 6c3ee3c46d
7 changed files with 95 additions and 57 deletions

View File

@@ -53,6 +53,7 @@ public:
QList<QStringList> getLabelMacros(const QList<QStringList>&, const QString&);
QStringList getLabelValues(const QList<QStringList>&, const QString&);
bool tryParseJsonFile(QJsonDocument *out, const QString &filepath);
bool tryParseOrderedJsonFile(poryjson::Json::object *out, const QString &filepath);
bool ensureFieldsExist(const QJsonObject &obj, const QList<QString> &fields);
// Returns the 1-indexed line number for the definition of scriptLabel in the scripts file at filePath.

View File

@@ -3,6 +3,7 @@
#define GUARD_WILDMONINFO_H
#include <QtWidgets>
#include "orderedmap.h"
struct WildPokemon {
int minLevel = 5;
@@ -17,13 +18,13 @@ struct WildMonInfo {
};
struct WildPokemonHeader {
QHash<QString, WildMonInfo> wildMons;
tsl::ordered_map<QString, WildMonInfo> wildMons;
};
struct EncounterField {
QString name;
QVector<int> encounterRates;
QMap<QString, QVector<int>> groups;
tsl::ordered_map<QString, QVector<int>> groups;
};
typedef QVector<EncounterField> EncounterFields;