Unfuck mostly everything.

This commit is contained in:
FL-OZ
2020-04-30 18:08:51 -05:00
parent 8e0185f892
commit 93c3e86c9f
7 changed files with 69 additions and 52 deletions

View File

@@ -0,0 +1,41 @@
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.Prototypes.Kitchen
{
/// <summary>
/// A recipe for space microwaves.
/// </summary>
[Prototype("microwaveMealRecipe")]
public class MealRecipePrototype : 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>());
}
}
}