aboutsummaryrefslogtreecommitdiff
path: root/internal/action
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-17 17:34:40 -0400
committerhistoria <[not public]>2026-06-17 17:34:40 -0400
commiteef5ddaa94f8cff6010d092c30fed53d2be01524 (patch)
tree3026ebb5fe34fd778c5f8f6b6d23aec337a99b99 /internal/action
parent04998e3e4eff075eee6d00850c752c3c73ab66b5 (diff)
downloadthehouseoficarus-eef5ddaa94f8cff6010d092c30fed53d2be01524.tar.gz
feat: began implementing smithing, ground item display fixes.
Diffstat (limited to 'internal/action')
-rw-r--r--internal/action/recipe.go20
1 files changed, 20 insertions, 0 deletions
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