aboutsummaryrefslogtreecommitdiff
path: root/internal/player/player.go
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/player/player.go
parent04998e3e4eff075eee6d00850c752c3c73ab66b5 (diff)
downloadthehouseoficarus-eef5ddaa94f8cff6010d092c30fed53d2be01524.tar.gz
feat: began implementing smithing, ground item display fixes.
Diffstat (limited to 'internal/player/player.go')
-rw-r--r--internal/player/player.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/player/player.go b/internal/player/player.go
index 48c9359..e7d98ac 100644
--- a/internal/player/player.go
+++ b/internal/player/player.go
@@ -338,6 +338,16 @@ func (p *Player) HasItem(itemID string) bool {
return false
}
+func (p *Player) CountItem(itemID string) int {
+ count := 0
+ for _, slot := range p.Inventory {
+ if slot != nil && slot.ItemID == itemID {
+ count += slot.Quantity
+ }
+ }
+ return count
+}
+
func (p *Player) RemoveItem(itemID string, qty int) bool {
remaining := qty
for i, slot := range p.Inventory {