Add minimal Bluegill fishing loop

This commit is contained in:
Alexander Sellite 2026-07-25 11:05:37 -04:00
parent dd2563c0d8
commit bba93eb3e5
16 changed files with 461 additions and 3 deletions

View file

@ -0,0 +1,21 @@
class_name FishInventory
extends Node
const FishDataType = preload("res://fish/fish_data.gd")
signal contents_changed(fish_id: StringName, count: int)
var _fish_counts: Dictionary[StringName, int] = {}
func add_fish(fish: FishDataType, amount: int = 1) -> void:
if fish == null or fish.id.is_empty() or amount <= 0:
return
var new_count: int = get_count(fish.id) + amount
_fish_counts[fish.id] = new_count
contents_changed.emit(fish.id, new_count)
func get_count(fish_id: StringName) -> int:
return _fish_counts.get(fish_id, 0)