Files
OldThink/Content.Server/_White/GuideGenerator/EntityJsonGenerator.cs
Valtos a5cddf1223 json generator alternator and vibrator (#718)
* json generator alternator and vibrator

* каким хуем ты не закоммитился уебан
2024-09-29 01:15:33 +03:00

28 lines
743 B
C#

using System.IO;
using System.Linq;
using System.Text.Json;
using Robust.Shared.Prototypes;
namespace Content.Server.GuideGenerator;
public sealed class EntityJsonGenerator
{
public static void PublishJson(StreamWriter file)
{
var prototype = IoCManager.Resolve<IPrototypeManager>();
var prototypes =
prototype
.EnumeratePrototypes<EntityPrototype>()
.Where(x => !x.Abstract)
.Select(x => new EntityEntry(x))
.ToDictionary(x => x.Id, x => x);
var serializeOptions = new JsonSerializerOptions
{
WriteIndented = true,
};
file.Write(JsonSerializer.Serialize(prototypes, serializeOptions));
}
}