Content PR for YAML hot reloading (#3319)

* Content PR for YAML hot reloading

* Add CanAdminReloadPrototypes (host permission)

* IndexedPrototype fixes
This commit is contained in:
DrSmugleaf
2021-02-20 00:05:24 +01:00
committed by GitHub
parent 0ae4a6792f
commit 3e702723fd
42 changed files with 95 additions and 54 deletions

View File

@@ -9,20 +9,17 @@ namespace Content.Shared.Prototypes.Kitchen
/// <summary>
/// A recipe for space microwaves.
/// </summary>
[Prototype("microwaveMealRecipe")]
public class FoodRecipePrototype : IPrototype, IIndexedPrototype
public class FoodRecipePrototype : IPrototype
{
private string _id;
private string _name;
private string _result;
private int _cookTime;
private Dictionary<string, int> _ingsReagents;
private Dictionary<string, int> _ingsSolids;
public string Name => Loc.GetString(_name);
public string ID => _id;
public string Result => _result;
@@ -30,7 +27,6 @@ namespace Content.Shared.Prototypes.Kitchen
public IReadOnlyDictionary<string, int> IngredientsReagents => _ingsReagents;
public IReadOnlyDictionary<string, int> IngredientsSolids => _ingsSolids;
public void LoadFrom(YamlMappingNode mapping)
{
var serializer = YamlObjectSerializer.NewReader(mapping);
@@ -42,6 +38,5 @@ namespace Content.Shared.Prototypes.Kitchen
serializer.DataField(ref _ingsSolids, "solids", new Dictionary<string, int>());
serializer.DataField(ref _cookTime, "time", 5);
}
}
}