diff --git a/RaisedGardenBeds/AssetManager.cs b/RaisedGardenBeds/AssetManager.cs index 2d17818..014ac86 100644 --- a/RaisedGardenBeds/AssetManager.cs +++ b/RaisedGardenBeds/AssetManager.cs @@ -168,7 +168,7 @@ Game data // Patch in dummy object entries after generic object entry for (int i = 1; i < ModEntry.ItemDefinitions.Count; ++i) { - Content.ContentData d = ModEntry.ItemDefinitions[ModEntry.ItemDefinitions.Keys.ElementAt(i)]; + ItemDefinition d = ModEntry.ItemDefinitions[ModEntry.ItemDefinitions.Keys.ElementAt(i)]; name = Translations.GetNameTranslation(data: d); fields = data[id].Split('/'); fields[4] = description; @@ -194,11 +194,11 @@ Game data // Add crafting recipes for all object variants var data = asset.AsDictionary().Data; - foreach (KeyValuePair idAndFields in ModEntry.ItemDefinitions) + foreach (KeyValuePair idAndFields in ModEntry.ItemDefinitions) { string[] newFields = new string[] { // Crafting ingredients: - Content.ContentData.ParseRecipeIngredients(data: idAndFields.Value), + ItemDefinition.ParseRecipeIngredients(data: idAndFields.Value), // Unused field: "blue berry", // Crafted item ID and quantity: diff --git a/RaisedGardenBeds/Content/ContentData.cs b/RaisedGardenBeds/ItemDefinition.cs similarity index 93% rename from RaisedGardenBeds/Content/ContentData.cs rename to RaisedGardenBeds/ItemDefinition.cs index 86cdf07..beeb7f6 100644 --- a/RaisedGardenBeds/Content/ContentData.cs +++ b/RaisedGardenBeds/ItemDefinition.cs @@ -4,9 +4,9 @@ using System.Collections.Generic; using System.Linq; -namespace RaisedGardenBeds.Content +namespace RaisedGardenBeds { - public class ContentData + public class ItemDefinition { /*************** Required entries @@ -71,7 +71,7 @@ Optional entries [JsonIgnore] public int SpriteIndex { get; set; } /// - /// The dictionary aggregated to a string + /// The dictionary aggregated to a string /// with all "Object" fields parsed to their equivalent . /// Has no entry in the content data file. /// @@ -89,7 +89,7 @@ Internal values Internal methods ***************/ - internal static string ParseRecipeIngredients(ContentData data) + internal static string ParseRecipeIngredients(ItemDefinition data) { List ingredients = new List(); foreach (Dictionary entry in data.RecipeIngredients) diff --git a/RaisedGardenBeds/ModEntry.cs b/RaisedGardenBeds/ModEntry.cs index 8c50feb..1bf45d0 100644 --- a/RaisedGardenBeds/ModEntry.cs +++ b/RaisedGardenBeds/ModEntry.cs @@ -21,7 +21,7 @@ public class ModEntry : Mod /// Shared object variant dictionary containing entries provided by the content pack, as well as some metadata about the content pack itself. /// Entries are keyed by - internal static Dictionary ItemDefinitions = null; + internal static Dictionary ItemDefinitions = null; /// /// Shared object spritesheet dictionary containing object icon, world sprite component, object breakage, and watered/unwatered soil sprites. /// Entries are keyed by (); + ItemDefinitions = new Dictionary(); Sprites = new Dictionary(); List contentPacks = Helper.ContentPacks.GetOwned().ToList(); @@ -242,10 +242,10 @@ public void LoadContentPacks() string packKey = contentPack.Manifest.UniqueID; var sprites = contentPack.LoadAsset - (Content.ContentData.SpritesFile); + (ItemDefinition.SpritesFile); var data = contentPack.ReadJsonFile - > - (Content.ContentData.DefinitionsFile); + > + (ItemDefinition.DefinitionsFile); // For some quality assurance, we check that there are an equal number of entries in the // ItemDefinitions dictionary as there are sprites in the shared framework spritesheet. @@ -289,7 +289,7 @@ public void LoadContentPacks() } int parentSheetIndex = 0; - foreach (KeyValuePair entry in data) + foreach (KeyValuePair entry in data) { string variantKey = $"{packKey}.{entry.Key}"; diff --git a/RaisedGardenBeds/Translations.cs b/RaisedGardenBeds/Translations.cs index b7ae1f9..4116c5e 100644 --- a/RaisedGardenBeds/Translations.cs +++ b/RaisedGardenBeds/Translations.cs @@ -66,7 +66,7 @@ public static string GetTranslation(string key, object[] tokens = null) /// Return the display name for an item definition in the dictionary. /// /// Item definition entry. - public static string GetNameTranslation(Content.ContentData data) + public static string GetNameTranslation(ItemDefinition data) { string pack = data.ContentPack.Manifest.UniqueID; string item = data.LocalName;