Fix warnings and code cleanup/fixes (#13570)
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Content.Shared.Kitchen
|
||||
public sealed class FoodRecipePrototype : IPrototype
|
||||
{
|
||||
[ViewVariables]
|
||||
[IdDataFieldAttribute]
|
||||
[IdDataField]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[DataField("name")]
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
using System.Linq;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Kitchen
|
||||
{
|
||||
@@ -21,19 +22,9 @@ namespace Content.Shared.Kitchen
|
||||
/// <summary>
|
||||
/// Check if a prototype ids appears in any of the recipes that exist.
|
||||
/// </summary>
|
||||
/// <param name="solidIds"></param>
|
||||
/// <returns></returns>
|
||||
public bool SolidAppears(string solidId)
|
||||
{
|
||||
foreach(var recipe in Recipes)
|
||||
{
|
||||
if(recipe.IngredientsSolids.ContainsKey(solidId))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return Recipes.Any(recipe => recipe.IngredientsSolids.ContainsKey(solidId));
|
||||
}
|
||||
|
||||
private sealed class RecipeComparer : Comparer<FoodRecipePrototype>
|
||||
|
||||
Reference in New Issue
Block a user