I have a JSON file that I parsed into a Godot.Collections.Dictionary.
An example JSON entry looks like this:
"R011": {
"ItemName": "TreeBranch",
"ItemCategory": "Resource",
"StackSize": 40,
"Description": "A sturdy branch used for crafting."
},
Which is parsed with the method
Godot.Collections.Dictionary LoadData(string filePath)
{
JSONParseResult jsonData;
File fileData = new File();
fileData.Open(filePath, File.ModeFlags.Read);
jsonData = JSON.Parse(fileData.GetAsText());
fileData.Close();
return (Godot.Collections.Dictionary)jsonData.Result;
}
Which is part of an autoloaded script for the game's databases and returns the entire set of values like this
{Description:A sturdy branch used for crafting., ItemCategory:Resource, ItemName:TreeBranch, StackSize:40}
I wonder if there is a way to get just the value I am looking for. For instance, is there a way to use "Stacksize" as a key to get only R011's Stacksize?