Skip to content

Commit

Permalink
code review feedback
Browse files Browse the repository at this point in the history
Replaced File.ReadAllText with Util.ReadAllText.
  • Loading branch information
pacampbell committed Dec 21, 2024
1 parent ee1a11f commit 1410825
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public BitterblackMazeAsset ReadPath(string path)

BitterblackMazeAsset asset = new BitterblackMazeAsset();

string json = File.ReadAllText(path);
string json = Util.ReadAllText(path);
JsonDocument document = JsonDocument.Parse(json);

var configurations = document.RootElement.GetProperty("maze_configurations").EnumerateObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public BonusDungeonAsset ReadPath(string path)

BonusDungeonAsset asset = new BonusDungeonAsset();

string json = File.ReadAllText(path);
string json = Util.ReadAllText(path);
JsonDocument document = JsonDocument.Parse(json);

foreach (var jCategory in document.RootElement.EnumerateArray())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public CostExpScalingAsset ReadPath(string path)

CostExpScalingAsset asset = new CostExpScalingAsset();

string json = File.ReadAllText(path);
string json = Util.ReadAllText(path);
JsonDocument document = JsonDocument.Parse(json);

var costExpInfoElements = document.RootElement.EnumerateArray().ToList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public EnemySpawnAsset ReadPath(string path)

EnemySpawnAsset asset = new EnemySpawnAsset();

string json = File.ReadAllText(path);
string json = Util.ReadAllText(path);
JsonDocument document = JsonDocument.Parse(json);

JsonElement schemasElement = document.RootElement.GetProperty("schemas");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public EpitaphRoadAsset ReadPath(string path)

EpitaphRoadAsset asset = new EpitaphRoadAsset();

string json = File.ReadAllText(path);
string json = Util.ReadAllText(path);
JsonDocument document = JsonDocument.Parse(json);

foreach (var jEpiPath in document.RootElement.GetProperty("paths").EnumerateArray())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public bool LoadTrialsFromDirectory(string path, EpitaphTrialAsset trialAssets)
{
Logger.Info($"{file.FullName}");

string json = File.ReadAllText(file.FullName);
string json = Util.ReadAllText(file.FullName);
JsonDocument document = JsonDocument.Parse(json);

var assetData = new EpitaphTrial();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public EventDropsAsset ReadPath(string path)

EventDropsAsset asset = new EventDropsAsset();

string json = File.ReadAllText(path);
string json = Util.ReadAllText(path);
JsonDocument document = JsonDocument.Parse(json);

foreach (var jEventItem in document.RootElement.EnumerateArray())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public GPCourseInfoAsset ReadPath(string path)

GPCourseInfoAsset asset = new GPCourseInfoAsset();

string json = File.ReadAllText(path);
string json = Util.ReadAllText(path);
JsonDocument document = JsonDocument.Parse(json);

var ValidCourses = document.RootElement.GetProperty("valid_courses").EnumerateArray().ToList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public LearnedNormalSkillsAsset ReadPath(string path)

LearnedNormalSkillsAsset asset = new LearnedNormalSkillsAsset();

string json = File.ReadAllText(path);
string json = Util.ReadAllText(path);
JsonDocument document = JsonDocument.Parse(json);

// List<uint> Keys = document.RootElement.EnumerateObject().ToList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public Dictionary<uint, NamedParam> ReadPath(string path)

Dictionary<uint, NamedParam> namedParams = new Dictionary<uint, NamedParam>();

string json = File.ReadAllText(path);
string json = Util.ReadAllText(path);
JsonDocument document = JsonDocument.Parse(json);
JsonElement namedParamListElement = document.RootElement.GetProperty("namedParamList");
foreach (JsonElement namedParamListEntryElement in namedParamListElement.EnumerateArray())
Expand Down Expand Up @@ -54,4 +54,4 @@ public Dictionary<uint, NamedParam> ReadPath(string path)
return namedParams;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public PawnCostReductionAsset ReadPath(string path)

var asset = new PawnCostReductionAsset();

string json = File.ReadAllText(path);
string json = Util.ReadAllText(path);
using (JsonDocument document = JsonDocument.Parse(json))
{
var costReductionElements = document.RootElement.EnumerateArray().ToList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public bool LoadQuestsFromDirectory(string path, QuestAsset questAssets)
{
Logger.Info($"{file.FullName}");

string json = File.ReadAllText(file.FullName);
string json = Util.ReadAllText(file.FullName);
JsonDocument document = JsonDocument.Parse(json);

var jQuest = document.RootElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public QuestDropItemAsset ReadPath(string path)

QuestDropItemAsset asset = new QuestDropItemAsset();

string json = File.ReadAllText(path);
string json = Util.ReadAllText(path);
JsonDocument document = JsonDocument.Parse(json);

JsonElement dropsTablesElement = document.RootElement.GetProperty("dropsTables");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public RecruitmentBoardCategoryAsset ReadPath(string path)

RecruitmentBoardCategoryAsset asset = new RecruitmentBoardCategoryAsset();

string json = File.ReadAllText(path);
string json = Util.ReadAllText(path);
JsonDocument document = JsonDocument.Parse(json);

foreach (var category in document.RootElement.EnumerateArray().ToList())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public SecretAbilityAsset ReadPath(string path)

SecretAbilityAsset asset = new SecretAbilityAsset();

string json = File.ReadAllText(path);
string json = Util.ReadAllText(path);
JsonDocument document = JsonDocument.Parse(json);

var secretAbilities = document.RootElement.GetProperty("default_abilitiles").EnumerateArray().ToList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public SpecialShopAsset ReadPath(string path)

SpecialShopAsset asset = new SpecialShopAsset();

string json = File.ReadAllText(path);
string json = Util.ReadAllText(path);
JsonDocument document = JsonDocument.Parse(json);

uint categoryId = 0;
Expand Down

0 comments on commit 1410825

Please sign in to comment.