class_name GameState
extends Resource

const INVENTORY_ITEM_DB = {
	&"meat": preload("res://data/meat.tres"),
}

# keys are multiplayer ID ints, values are PlayerData
@export var player_data := {}
# keys are InventoryItem resource IDs (from db), values are InventoryItems
@export var inventory := {}
@export var coins: int

static var _instance := GameState.new()


static func save() -> void:
	ResourceSaver.save(_instance, "user://game_state.tres")


static func fetch() -> GameState:
	return _instance
