extends Node
## PlayerInfo 
# Tracks player info for other nodes
# and UI elements. 
# Manages PlayerData objects for inventory and maybe saving later.

## An array of player data objects
var _player_data :Array = []

# Called when the node enters the scene tree for the first time.
func _ready():
	pass # Replace with function body.

func register_player() -> int:
	_player_data.append(PlayerData.new())
	## Return the index of the player data
	return (_player_data.size() - 1 ) 

func get_player_data(index :int) -> PlayerData:
	if _player_data.size() > index:
		return _player_data[index]
	else:
		return null

func reset():
	_player_data.clear()

# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
#	pass
