Files
tbd-station-14/Content.Shared/Kitchen/MicrowaveMealRecipePrototype.cs
FL-OZ 8e0185f892 Refactor "output" to "result" for recipes/prototypes.
Remove a debug recipe from meal_recipes.yml
Add food.yml for food related reagents: sugar, flour, etc.
2020-04-29 21:04:08 -05:00

42 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using Robust.Shared.Localization;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
using YamlDotNet.RepresentationModel;
namespace Content.Shared.Kitchen
{
/// <summary>
/// A recipe for space microwaves.
/// </summary>
[Prototype("microwaveMealRecipe")]
public class MicrowaveMealRecipePrototype : IPrototype, IIndexedPrototype
{
private string _id;
private string _name;
private string _result;
private Dictionary<string, int> _ingredients;
public string ID => _id;
public string Name => Loc.GetString(_name);
public string Result => _result;
public IReadOnlyDictionary<string, int> Ingredients => _ingredients;
public void LoadFrom(YamlMappingNode mapping)
{
var serializer = YamlObjectSerializer.NewReader(mapping);
serializer.DataField(ref _id, "id", string.Empty);
serializer.DataField(ref _name, "name", string.Empty);
serializer.DataField(ref _result, "result", string.Empty);
serializer.DataField(ref _ingredients, "ingredients", new Dictionary<string, int>());
}
}
}