From 567c422f8cd42eba2437f9a8c2522716a1649be7 Mon Sep 17 00:00:00 2001 From: hazel Date: Mon, 26 Jan 2026 22:04:39 +0100 Subject: celesteia archive, last updated april 9th 2024 Signed-off-by: hazel --- source/resources/management/RecipeManager.cs | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 source/resources/management/RecipeManager.cs (limited to 'source/resources/management/RecipeManager.cs') diff --git a/source/resources/management/RecipeManager.cs b/source/resources/management/RecipeManager.cs new file mode 100644 index 0000000..fb6df07 --- /dev/null +++ b/source/resources/management/RecipeManager.cs @@ -0,0 +1,34 @@ +using System.Collections.Generic; +using System.Diagnostics; +using Celesteia.Resources.Types; +using Microsoft.Xna.Framework.Content; + +namespace Celesteia.Resources.Management { + public class RecipeManager : IResourceManager { + public List Recipes; + + private List _collections = new List(); + public void AddCollection(IResourceCollection collection) => _collections.Add(collection); + + public void LoadContent(ContentManager Content) { + Debug.WriteLine($"Loading crafting recipes..."); + + Recipes = new List(); + + foreach (IResourceCollection collection in _collections) + LoadCollection(collection); + } + + private void LoadCollection(IResourceCollection collection) { + foreach (NamespacedKey key in collection.GetRecipes().Keys) { + AddType(collection.GetRecipes()[key]); + } + } + + private void AddType(Recipe recipe) { + Recipes.Add(recipe); + } + + public IResourceType GetResource(NamespacedKey namespacedKey) => null; + } +} \ No newline at end of file -- cgit v1.2.3