Unfuck mostly everything.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared
|
||||
namespace Content.Shared
|
||||
{
|
||||
public class EntryPoint : GameShared
|
||||
{
|
||||
@@ -55,5 +55,6 @@
|
||||
|
||||
_tileDefinitionManager.Initialize();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
52
Content.Shared/Kitchen/RecipeManager.cs
Normal file
52
Content.Shared/Kitchen/RecipeManager.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared.Prototypes.Kitchen;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Kitchen
|
||||
{
|
||||
|
||||
public class RecipeManager
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager;
|
||||
#pragma warning restore 649
|
||||
public List<MealRecipePrototype> Recipes { get; private set; }
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
Recipes = new List<MealRecipePrototype>();
|
||||
foreach (var item in _prototypeManager.EnumeratePrototypes<MealRecipePrototype>())
|
||||
{
|
||||
Recipes.Add(item);
|
||||
}
|
||||
|
||||
Recipes.Sort(new RecipeComparer());
|
||||
}
|
||||
private class RecipeComparer : IComparer<MealRecipePrototype>
|
||||
{
|
||||
int IComparer<MealRecipePrototype>.Compare(MealRecipePrototype x, MealRecipePrototype y)
|
||||
{
|
||||
if (x == null || y == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (x.Ingredients.Count < y.Ingredients.Count)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (x.Ingredients.Count > y.Ingredients.Count)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Utility;
|
||||
using YamlDotNet.RepresentationModel;
|
||||
|
||||
namespace Content.Shared.Kitchen
|
||||
namespace Content.Shared.Prototypes.Kitchen
|
||||
{
|
||||
/// <summary>
|
||||
/// A recipe for space microwaves.
|
||||
@@ -15,7 +15,7 @@ namespace Content.Shared.Kitchen
|
||||
|
||||
[Prototype("microwaveMealRecipe")]
|
||||
|
||||
public class MicrowaveMealRecipePrototype : IPrototype, IIndexedPrototype
|
||||
public class MealRecipePrototype : IPrototype, IIndexedPrototype
|
||||
{
|
||||
|
||||
private string _id;
|
||||
Reference in New Issue
Block a user