diff options
Diffstat (limited to 'internal/game/core_utils.go')
| -rw-r--r-- | internal/game/core_utils.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/game/core_utils.go b/internal/game/core_utils.go index 2855bcf..71d0acb 100644 --- a/internal/game/core_utils.go +++ b/internal/game/core_utils.go @@ -149,3 +149,13 @@ func (g *Game) newInventorySlot(itemID string, qty int) *player.InventorySlot { } return slot } + +func countChips(p *player.Player) int { + total := 0 + for _, slot := range p.Inventory { + if slot != nil && slot.ItemID == "chips" { + total += slot.Quantity + } + } + return total +} |
