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

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

36 lines
1.3 KiB
C#

using Content.Server._White.GuideGenerator;
using Content.Shared.Chemistry.Reaction;
using Robust.Shared.Prototypes;
namespace Content.Server.GuideGenerator;
public sealed partial class ReactionJsonGenerator
{
[ValidatePrototypeId<MixingCategoryPrototype>]
private const string DefaultMixingCategory = "DummyMix";
private static void AddMixingCategories(Dictionary<String, ReactionEntry> reactions, IPrototypeManager prototype)
{
foreach (var reaction in reactions)
{
var reactionPrototype = prototype.Index<ReactionPrototype>(reaction.Key);
var mixingCategories = new List<MixingCategoryPrototype>();
if (reactionPrototype.MixingCategories != null)
{
foreach (var category in reactionPrototype.MixingCategories)
{
mixingCategories.Add(prototype.Index(category));
}
}
else
{
mixingCategories.Add(prototype.Index<MixingCategoryPrototype>(DefaultMixingCategory));
}
foreach (var mixingCategory in mixingCategories)
{
reactions[reaction.Key].MixingCategories.Add(new MixingCategoryEntry(mixingCategory));
}
}
}
}