using System.IO; using System.Linq; using System.Text.Json; using Content.Shared.Chemistry.Reaction; using Content.Shared.FixedPoint; using Robust.Shared.IoC; using Robust.Shared.Prototypes; namespace Content.Server.GuideGenerator; public class ReactionJsonGenerator { public static void PublishJson(StreamWriter file) { var prototype = IoCManager.Resolve(); var reactions = prototype .EnumeratePrototypes() .Select(x => new ReactionEntry(x)) .ToDictionary(x => x.Id, x => x); file.Write(JsonSerializer.Serialize(reactions, new JsonSerializerOptions { WriteIndented = true, IncludeFields = true })); } }