I was just recommended this interesting approach by gpt, idk if it's working(haven't tested yet) or bad practice, but I do like it because it gives you control over how each element is handled, I like that:
public void LoadFromJson(string json)
{
using (JsonDocument document = JsonDocument.Parse(json))
{
JsonElement root = document.RootElement;
if (root.TryGetProperty("General", out JsonElement generalElement))
{
if (generalElement.TryGetProperty("FPS", out JsonElement fpsElement))
{
General.FPS = fpsElement.GetInt32(); // Calls the FPS setter and triggers event
}
}
}
}
nameless37.6 has been warned.

