Skip to content

Commit

Permalink
rename CraftIngredient -> CraftingRecipeIngredient
Browse files Browse the repository at this point in the history
  • Loading branch information
lodicolo committed Feb 27, 2025
1 parent 1061b28 commit a57fcf9
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Intersect.Framework.Core.GameObjects.Crafting;
public partial class CraftBase : DatabaseObject<CraftBase>, IFolderable
{
[NotMapped]
public List<CraftIngredient> Ingredients { get; set; } = [];
public List<CraftingRecipeIngredient> Ingredients { get; set; } = [];

[JsonConstructor]
public CraftBase(Guid id) : base(id)
Expand All @@ -28,7 +28,7 @@ public CraftBase()
public string IngredientsJson
{
get => JsonConvert.SerializeObject(Ingredients, Formatting.None);
protected set => Ingredients = JsonConvert.DeserializeObject<List<CraftIngredient>>(value);
protected set => Ingredients = JsonConvert.DeserializeObject<List<CraftingRecipeIngredient>>(value);
}

[JsonProperty(Order = -6)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace Intersect.Framework.Core.GameObjects.Crafting;

public partial class CraftIngredient
public partial class CraftingRecipeIngredient
{
public Guid ItemId { get; set; }

public int Quantity { get; set; }

public CraftIngredient(Guid itemId, int quantity)
public CraftingRecipeIngredient(Guid itemId, int quantity)
{
ItemId = itemId;
Quantity = quantity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private void LoadCraftRecipe(CraftBase craftDescriptor)
}

var craftedItemDescriptorId = craftDescriptor.ItemId;
_craftedItem = new RecipeItem(this, new CraftIngredient(craftedItemDescriptorId, 0))
_craftedItem = new RecipeItem(this, new CraftingRecipeIngredient(craftedItemDescriptorId, 0))
{
Container = new ImagePanel(this, "CraftedItem"),
};
Expand Down
4 changes: 2 additions & 2 deletions Intersect.Client.Core/Interface/Game/Crafting/RecipeItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public partial class RecipeItem
private Draggable? mDragIcon;

//Slot info
CraftIngredient mIngredient;
CraftingRecipeIngredient mIngredient;

//Mouse Event Variables
private bool mMouseOver;
Expand All @@ -38,7 +38,7 @@ public partial class RecipeItem

public ImagePanel? Pnl;

public RecipeItem(CraftingWindow craftingWindow, CraftIngredient ingredient)
public RecipeItem(CraftingWindow craftingWindow, CraftingRecipeIngredient ingredient)
{
mCraftingWindow = craftingWindow;
mIngredient = ingredient;
Expand Down
4 changes: 2 additions & 2 deletions Intersect.Editor/Forms/Editors/frmCrafts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private void nudItemLossChance_ValueChanged(object sender, EventArgs e)

private void btnAdd_Click(object sender, EventArgs e)
{
mEditorItem.Ingredients.Add(new CraftIngredient(Guid.Empty, 1));
mEditorItem.Ingredients.Add(new CraftingRecipeIngredient(Guid.Empty, 1));
lstIngredients.Items.Add(Strings.General.None);
lstIngredients.SelectedIndex = lstIngredients.Items.Count - 1;
cmbIngredient_SelectedIndexChanged(null, null);
Expand Down Expand Up @@ -363,7 +363,7 @@ private void btnDupIngredient_Click(object sender, EventArgs e)
{
mEditorItem.Ingredients.Insert(
lstIngredients.SelectedIndex,
new CraftIngredient(
new CraftingRecipeIngredient(
mEditorItem.Ingredients[lstIngredients.SelectedIndex].ItemId,
mEditorItem.Ingredients[lstIngredients.SelectedIndex].Quantity
)
Expand Down

0 comments on commit a57fcf9

Please sign in to comment.