Add (not working) basis for allowing solids (entities) in recipes.

This commit is contained in:
FL-OZ
2020-05-02 01:29:20 -05:00
parent dd19466578
commit dba0949c5b
9 changed files with 132 additions and 56 deletions

View File

@@ -33,12 +33,12 @@ namespace Content.Shared.Kitchen
return 0;
}
if (x._ingredients.Count < y._ingredients.Count)
if (x._ingReagents.Count < y._ingReagents.Count)
{
return 1;
}
if (x._ingredients.Count > y._ingredients.Count)
if (x._ingReagents.Count > y._ingReagents.Count)
{
return -1;
}

View File

@@ -1,17 +0,0 @@
using Robust.Shared.Serialization;
using System;
using System.Collections.Generic;
using System.Text;
namespace Content.Shared.Kitchen
{
[Serializable, NetSerializable]
public enum MicrowaveVisualState
{
Idle,
Cooking
}
}

View File

@@ -37,10 +37,12 @@ namespace Content.Shared.Kitchen
[NetSerializable, Serializable]
public class MicrowaveUserInterfaceState : BoundUserInterfaceState
{
public readonly List<Solution.ReagentQuantity> ContainedReagents;
public MicrowaveUserInterfaceState(List<Solution.ReagentQuantity> contained)
public readonly List<Solution.ReagentQuantity> ReagentsReagents;
public readonly Dictionary<string, int> ContainedSolids;
public MicrowaveUserInterfaceState(List<Solution.ReagentQuantity> reagents, Dictionary<string,int> solids)
{
ContainedReagents = contained;
ReagentsReagents = reagents;
ContainedSolids = solids;
}
}

View File

@@ -22,8 +22,11 @@ namespace Content.Shared.Prototypes.Kitchen
public string _name => Loc.GetString(Name);
private string Name;
public string _result;
public IReadOnlyDictionary<string, int> _ingredients => Ingredients;
private Dictionary<string, int> Ingredients;
public IReadOnlyDictionary<string, int> _ingReagents => IngredientsReagents;
public IReadOnlyDictionary<string, int> _ingSolids => IngredientsSolids;
private Dictionary<string, int> IngredientsReagents;
private Dictionary<string, int> IngredientsSolids;
public int _cookTime;
public string ID => _id;
@@ -35,7 +38,8 @@ namespace Content.Shared.Prototypes.Kitchen
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>());
serializer.DataField(ref IngredientsReagents, "reagents", new Dictionary<string, int>());
serializer.DataField(ref IngredientsSolids, "solids", new Dictionary<string, int>());
serializer.DataField(ref _cookTime, "time", 5);
}