using System.Linq; using System.Text.Json.Serialization; using Content.Shared.Kitchen; namespace Content.Server.GuideGenerator; public sealed class MicrowaveRecipeEntry { /// /// Id of recipe /// [JsonPropertyName("id")] public string Id { get; } /// /// Human-readable name of recipe. /// Should automatically be localized by default /// [JsonPropertyName("name")] public string Name { get; } /// /// Type of recipe /// [JsonPropertyName("type")] public string Type { get; } /// /// Time to cook something (for microwave recipes) /// [JsonPropertyName("time")] public uint Time { get; } /// /// Solids required to cook something /// [JsonPropertyName("solids")] public Dictionary Solids { get; } /// /// Reagents required to cook something /// [JsonPropertyName("reagents")] public Dictionary Reagents { get; } /// /// Result of a recipe /// [JsonPropertyName("result")] public string Result { get; } public MicrowaveRecipeEntry(FoodRecipePrototype proto) { Id = proto.ID; Name = TextTools.TextTools.CapitalizeString(proto.Name); Type = "microwaveRecipes"; Time = proto.CookTime; Solids = proto.IngredientsSolids .ToDictionary( sol => sol.Key, sol => (uint)(int)sol.Value.Int() ); Reagents = proto.IngredientsReagents .ToDictionary( rea => rea.Key, rea => (uint)(int)rea.Value.Int() ); Result = proto.Result; } }