From eef5ddaa94f8cff6010d092c30fed53d2be01524 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Wed, 17 Jun 2026 17:34:40 -0400 Subject: feat: began implementing smithing, ground item display fixes. --- internal/action/recipe.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'internal/action') diff --git a/internal/action/recipe.go b/internal/action/recipe.go index 7627047..18c08c5 100644 --- a/internal/action/recipe.go +++ b/internal/action/recipe.go @@ -196,6 +196,26 @@ func (r *RecipeDef) ConsumeAll(hasItem func(string) bool, removeItem func(string return true } +func (r *RecipeDef) HasAllItemsQty(countItem func(string) int) bool { + for _, e := range r.Consume { + found := false + for _, id := range e.Items { + qty := e.Qty + if qty <= 0 { + qty = 1 + } + if countItem(id) >= qty { + found = true + break + } + } + if !found { + return false + } + } + return true +} + func (r *RecipeDef) HasAllItems(hasItem func(string) bool) bool { for _, e := range r.Consume { found := false -- cgit v1.2.3