Add Eris microwave RSI.

Cleaned up  the Microwave component code.
This commit is contained in:
FL-OZ
2020-04-28 19:15:43 -05:00
parent 24842418c3
commit d0f18b2f66
13 changed files with 15 additions and 23 deletions

View File

@@ -101,26 +101,21 @@ namespace Content.Server.GameObjects.Components.Kitchen
{
if(_contents.ReagentList.Count > 0)
{
DetermineRecipe();
}
}
private void DetermineRecipe()
{
foreach (var r in _allRecipes)
{
if(CheckReagents(r))
foreach (var r in _allRecipes)
{
var outputFromRecipe = r.OutPutPrototype;
_entityManager.SpawnEntity(outputFromRecipe, Owner.Transform.GridPosition);
return;
}
if (CanSatisfyRecipe(r))
{
var outputFromRecipe = r.OutPutPrototype;
_entityManager.SpawnEntity(outputFromRecipe, Owner.Transform.GridPosition);
return;
}
}
}
}
private bool CheckReagents(MicrowaveMealRecipePrototype recipe)
private bool CanSatisfyRecipe(MicrowaveMealRecipePrototype recipe)
{
foreach(var ingredient in recipe.Ingredients)
{